Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
88934d39
Commit
88934d39
authored
17 years ago
by
Christopher J. Morrone
Browse files
Options
Downloads
Patches
Plain Diff
svn merge -r11705:11709
https://eris.llnl.gov/svn/slurm/branches/slurm-1.2
parent
a7c2fe71
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/salloc/msg.c
+16
-0
16 additions, 0 deletions
src/salloc/msg.c
src/salloc/salloc.c
+1
-0
1 addition, 0 deletions
src/salloc/salloc.c
with
17 additions
and
0 deletions
src/salloc/msg.c
+
16
−
0
View file @
88934d39
...
...
@@ -34,6 +34,7 @@
#include
<sys/un.h>
#include
<sys/types.h>
#include
<signal.h>
#include
<pthread.h>
#include
<slurm/slurm.h>
...
...
@@ -46,6 +47,7 @@
#include
"src/common/xmalloc.h"
#include
"src/common/slurm_auth.h"
#include
"src/common/eio.h"
#include
"src/common/xsignal.h"
#include
"src/salloc/salloc.h"
#include
"src/salloc/opt.h"
...
...
@@ -60,6 +62,8 @@ static uid_t slurm_uid;
static
void
_handle_msg
(
slurm_msg_t
*
msg
);
static
bool
_message_socket_readable
(
eio_obj_t
*
obj
);
static
int
_message_socket_accept
(
eio_obj_t
*
obj
,
List
objs
);
static
pthread_mutex_t
msg_thr_start_lock
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_cond_t
msg_thr_start_cond
=
PTHREAD_COND_INITIALIZER
;
static
struct
io_operations
message_socket_ops
=
{
readable:
&
_message_socket_readable
,
handle_read:
&
_message_socket_accept
...
...
@@ -67,7 +71,14 @@ static struct io_operations message_socket_ops = {
static
void
*
_msg_thr_internal
(
void
*
arg
)
{
int
signals
[]
=
{
SIGHUP
,
SIGINT
,
SIGQUIT
,
SIGPIPE
,
SIGTERM
,
SIGUSR1
,
SIGUSR2
,
0
};
debug
(
"Entering _msg_thr_internal"
);
xsignal_block
(
signals
);
pthread_mutex_lock
(
&
msg_thr_start_lock
);
pthread_cond_signal
(
&
msg_thr_start_cond
);
pthread_mutex_unlock
(
&
msg_thr_start_lock
);
eio_handle_mainloop
((
eio_handle_t
*
)
arg
);
debug
(
"Leaving _msg_thr_internal"
);
...
...
@@ -95,6 +106,7 @@ extern salloc_msg_thread_t *msg_thr_create(uint16_t *port)
msg_thr
->
handle
=
eio_handle_create
();
eio_new_initial_obj
(
msg_thr
->
handle
,
obj
);
pthread_mutex_lock
(
&
msg_thr_start_lock
);
if
(
pthread_create
(
&
msg_thr
->
id
,
NULL
,
_msg_thr_internal
,
(
void
*
)
msg_thr
->
handle
)
!=
0
)
{
error
(
"pthread_create of message thread: %m"
);
...
...
@@ -102,6 +114,10 @@ extern salloc_msg_thread_t *msg_thr_create(uint16_t *port)
xfree
(
msg_thr
);
return
NULL
;
}
/* Wait until the message thread has blocked signals
before continuing. */
pthread_cond_wait
(
&
msg_thr_start_cond
,
&
msg_thr_start_lock
);
pthread_mutex_unlock
(
&
msg_thr_start_lock
);
return
msg_thr
;
}
...
...
This diff is collapsed.
Click to expand it.
src/salloc/salloc.c
+
1
−
0
View file @
88934d39
...
...
@@ -126,6 +126,7 @@ int main(int argc, char *argv[])
}
else
{
error
(
"Failed to allocate resources: %m"
);
}
msg_thr_destroy
(
msg_thr
);
exit
(
1
);
}
after
=
time
(
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment