- Timestamp:
- Mar 25, 2011, 3:55:41 AM (14 years ago)
- Children:
- 567de81
- Parents:
- 8eb6068
- git-author:
- David Benjamin <davidben@mit.edu> (02/28/11 10:12:15)
- git-committer:
- David Benjamin <davidben@mit.edu> (03/25/11 03:55:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
signal.c
r87833a8 rf3b5dc8 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.