mirror of https://github.com/BOINC/boinc.git
parent
8b195ca1c7
commit
a2ddb241a4
|
@ -619,6 +619,7 @@ static void worker_timer(int /*a*/) {
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
void* timer_thread(void*) {
|
void* timer_thread(void*) {
|
||||||
|
block_sigalrm();
|
||||||
while(1) {
|
while(1) {
|
||||||
boinc_sleep(TIMER_PERIOD);
|
boinc_sleep(TIMER_PERIOD);
|
||||||
worker_timer(0);
|
worker_timer(0);
|
||||||
|
@ -789,4 +790,15 @@ void boinc_fpops_cumulative(double x) {
|
||||||
fpops_cumulative = x;
|
fpops_cumulative = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
// block SIGALRM, so that the worker thread will be forced to handle it
|
||||||
|
//
|
||||||
|
void block_sigalrm() {
|
||||||
|
sigset_t mask;
|
||||||
|
sigemptyset(&mask);
|
||||||
|
sigaddset(&mask, SIGALRM);
|
||||||
|
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *BOINC_RCSID_0fa0410386 = "$Id$";
|
const char *BOINC_RCSID_0fa0410386 = "$Id$";
|
||||||
|
|
|
@ -118,6 +118,8 @@ extern void options_defaults(BOINC_OPTIONS&);
|
||||||
extern APP_CLIENT_SHM *app_client_shm;
|
extern APP_CLIENT_SHM *app_client_shm;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern HANDLE worker_thread_handle;
|
extern HANDLE worker_thread_handle;
|
||||||
|
#else
|
||||||
|
extern void block_sigalrm();
|
||||||
#endif
|
#endif
|
||||||
extern int boinc_init_options_general(BOINC_OPTIONS& opt);
|
extern int boinc_init_options_general(BOINC_OPTIONS& opt);
|
||||||
extern int set_worker_timer(void);
|
extern int set_worker_timer(void);
|
||||||
|
|
|
@ -141,12 +141,7 @@ int start_worker_thread(WORKER_FUNC_PTR _worker_main) {
|
||||||
if (retval) return ERR_THREAD;
|
if (retval) return ERR_THREAD;
|
||||||
pthread_attr_destroy( &worker_thread_attr );
|
pthread_attr_destroy( &worker_thread_attr );
|
||||||
|
|
||||||
// block SIGLARM, so that the worker thread will be forced to handle it
|
block_sigalrm();
|
||||||
//
|
|
||||||
sigset_t mask;
|
|
||||||
sigemptyset(&mask);
|
|
||||||
sigaddset(&mask, SIGALRM);
|
|
||||||
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10403,3 +10403,12 @@ Rom 11 Aug 2005
|
||||||
ValidateAccountKey.cpp
|
ValidateAccountKey.cpp
|
||||||
ValidateURL.cpp
|
ValidateURL.cpp
|
||||||
WizAttachProject.cpp, .h
|
WizAttachProject.cpp, .h
|
||||||
|
|
||||||
|
David 11 Aug 2005
|
||||||
|
- API bug fix: block SIGALRM in timer thread
|
||||||
|
(make new function block_sigalrm();
|
||||||
|
call it from graphics, timer thread)
|
||||||
|
|
||||||
|
api/
|
||||||
|
boinc_api.C,h
|
||||||
|
graphics_impl.C
|
||||||
|
|
Loading…
Reference in New Issue