Changeset 44456 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Jan 30, 2013 10:59:47 AM (12 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/init.cpp
r40317 r44456 100 100 static char ** g_papszrtOrgArgs; 101 101 102 /** Are we running in unobtrusive mode? */ 103 static bool g_fUnobtrusive = false; 104 102 105 /** 103 106 * Program start nanosecond TS. … … 341 344 #endif 342 345 346 g_fUnobtrusive = fFlags & RTR3INIT_FLAGS_UNOBTRUSIVE; 347 343 348 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 344 349 # ifdef VBOX … … 484 489 { 485 490 /* no entry log flow, because prefixes and thread may freak out. */ 486 Assert(!(fFlags & ~(RTR3INIT_FLAGS_DLL | RTR3INIT_FLAGS_SUPLIB))); 491 Assert(!(fFlags & ~( RTR3INIT_FLAGS_DLL 492 | RTR3INIT_FLAGS_SUPLIB 493 | RTR3INIT_FLAGS_UNOBTRUSIVE))); 487 494 Assert(!(fFlags & RTR3INIT_FLAGS_DLL) || cArgs == 0); 488 495 … … 558 565 } 559 566 567 RTR3DECL(bool) RTR3InitIsUnobtrusive(void) 568 { 569 return g_fUnobtrusive; 570 } 560 571 561 572 #if 0 /** @todo implement RTR3Term. */ -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r44025 r44456 63 63 #include <iprt/asm.h> 64 64 #include <iprt/err.h> 65 #include <iprt/initterm.h> 65 66 #include <iprt/string.h> 66 67 #include "internal/thread.h" … … 149 150 150 151 g_iSigPokeThread = -1; 151 for (unsigned iSig = 0; iSig < RT_ELEMENTS(s_aiSigCandidates); iSig++) 152 { 153 struct sigaction SigActOld; 154 if (!sigaction(s_aiSigCandidates[iSig], NULL, &SigActOld)) 152 if (!RTR3InitIsUnobtrusive()) 153 { 154 for (unsigned iSig = 0; iSig < RT_ELEMENTS(s_aiSigCandidates); iSig++) 155 155 { 156 if ( SigActOld.sa_handler == SIG_DFL157 || SigActOld.sa_handler == rtThreadPosixPokeSignal)156 struct sigaction SigActOld; 157 if (!sigaction(s_aiSigCandidates[iSig], NULL, &SigActOld)) 158 158 { 159 struct sigaction SigAct; 160 RT_ZERO(SigAct); 161 SigAct.sa_handler = rtThreadPosixPokeSignal; 162 SigAct.sa_flags = 0; 163 sigfillset(&SigAct.sa_mask); 164 165 /* ASSUMES no sigaction race... (lazy bird) */ 166 if (!sigaction(s_aiSigCandidates[iSig], &SigAct, NULL)) 159 if ( SigActOld.sa_handler == SIG_DFL 160 || SigActOld.sa_handler == rtThreadPosixPokeSignal) 167 161 { 168 g_iSigPokeThread = s_aiSigCandidates[iSig]; 169 break; 162 struct sigaction SigAct; 163 RT_ZERO(SigAct); 164 SigAct.sa_handler = rtThreadPosixPokeSignal; 165 SigAct.sa_flags = 0; 166 sigfillset(&SigAct.sa_mask); 167 168 /* ASSUMES no sigaction race... (lazy bird) */ 169 if (!sigaction(s_aiSigCandidates[iSig], &SigAct, NULL)) 170 { 171 g_iSigPokeThread = s_aiSigCandidates[iSig]; 172 break; 173 } 174 AssertMsgFailed(("rc=%Rrc errno=%d\n", RTErrConvertFromErrno(errno), errno)); 170 175 } 176 } 177 else 171 178 AssertMsgFailed(("rc=%Rrc errno=%d\n", RTErrConvertFromErrno(errno), errno)); 172 }173 179 } 174 else175 AssertMsgFailed(("rc=%Rrc errno=%d\n", RTErrConvertFromErrno(errno), errno));176 180 } 177 181 #endif /* RTTHREAD_POSIX_WITH_POKE */ … … 231 235 * It will not help much if someone creates threads directly using pthread_create. :/ 232 236 */ 233 sigset_t SigSet; 234 sigemptyset(&SigSet); 235 sigaddset(&SigSet, SIGALRM); 236 sigprocmask(SIG_BLOCK, &SigSet, NULL); 237 if (!RTR3InitIsUnobtrusive()) 238 { 239 sigset_t SigSet; 240 sigemptyset(&SigSet); 241 sigaddset(&SigSet, SIGALRM); 242 sigprocmask(SIG_BLOCK, &SigSet, NULL); 243 } 237 244 #ifdef RTTHREAD_POSIX_WITH_POKE 238 245 if (g_iSigPokeThread != -1) -
trunk/src/VBox/Runtime/r3/posix/timer-posix.cpp
r43879 r44456 58 58 #include <iprt/once.h> 59 59 #include <iprt/err.h> 60 #include <iprt/initterm.h> 60 61 #include <iprt/critsect.h> 61 62 #include "internal/magics.h" … … 405 406 return VERR_NOT_SUPPORTED; 406 407 408 /* 409 * We need the signal masks to be set correctly, which they won't be in 410 * unobtrusive mode. 411 */ 412 if (RTR3InitIsUnobtrusive()) 413 return VERR_NOT_SUPPORTED; 414 407 415 #ifndef IPRT_WITH_POSIX_TIMERS 408 416 /*
Note:
See TracChangeset
for help on using the changeset viewer.