- Timestamp:
- May 23, 2011, 8:57:46 PM (12 years ago)
- Branches:
- master, release-1.8, release-1.9
- Children:
- 08e9842
- Parents:
- 47128d9
- git-author:
- David Benjamin <davidben@mit.edu> (02/28/11 10:12:15)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/23/11 20:57:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
signal.c
r81db142 r6bd485e 1 1 #include <glib.h> 2 #include <errno.h> 2 3 #include <pthread.h> 3 4 #include <signal.h> … … 21 22 void owl_signal_init(const sigset_t *set, void (*callback)(int, void*), void *data) { 22 23 GError *error = NULL; 24 int ret; 23 25 24 26 signal_set = *set; … … 26 28 signal_cbdata = data; 27 29 /* Block these signals in all threads, so we can get them. */ 28 pthread_sigmask(SIG_BLOCK, set, NULL); 30 if ((ret = pthread_sigmask(SIG_BLOCK, set, NULL)) != 0) { 31 errno = ret; 32 perror("pthread_sigmask"); 33 } 29 34 /* Spawn a dedicated thread to sigwait. */ 30 35 signal_thread = g_thread_create(signal_thread_func, NULL, FALSE, &error);
Note: See TracChangeset
for help on using the changeset viewer.