Changeset 90392 in vbox
- Timestamp:
- Jul 29, 2021 8:25:50 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/thread.h
r88688 r90392 261 261 * COINIT_SPEED_OVER_MEMORY. Ignored on non-windows platforms. */ 262 262 RTTHREADFLAGS_COM_STA = RT_BIT(2), 263 264 /** Mask all signals that we can mask. Ignored on most non-posix platforms. 265 * @note RTThreadPoke() will not necessarily work for a thread create with 266 * this flag. */ 267 RTTHREADFLAGS_NO_SIGNALS = RT_BIT(3), 263 268 264 269 /** Mask of valid flags, use for validation. */ -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r89870 r90392 238 238 } 239 239 240 static void rtThreadPosixBlockSignals(void) 241 { 240 static void rtThreadPosixBlockSignals(PRTTHREADINT pThread) 241 { 242 /* 243 * Mask all signals, including the poke one, if requested. 244 */ 245 if ( pThread 246 && (pThread->fFlags & RTTHREADFLAGS_NO_SIGNALS)) 247 { 248 sigset_t SigSet; 249 sigfillset(&SigSet); 250 int rc = sigprocmask(SIG_BLOCK, &SigSet, NULL); 251 AssertMsg(rc == 0, ("rc=%Rrc errno=%d\n", RTErrConvertFromErrno(errno), errno)); RT_NOREF(rc); 252 } 242 253 /* 243 254 * Block SIGALRM - required for timer-posix.cpp. … … 245 256 * It will not help much if someone creates threads directly using pthread_create. :/ 246 257 */ 247 if (!RTR3InitIsUnobtrusive())258 else if (!RTR3InitIsUnobtrusive()) 248 259 { 249 260 sigset_t SigSet; … … 255 266 #ifdef RTTHREAD_POSIX_WITH_POKE 256 267 /* 257 * bird 2020-10-28: Not entirely sure w e do this, but it makes sure the signal works268 * bird 2020-10-28: Not entirely sure why we do this, but it makes sure the signal works 258 269 * on the new thread. Probably some pre-NPTL linux reasons. 259 270 */ … … 286 297 rtThreadPosixSelectPokeSignal(); 287 298 #endif 288 rtThreadPosixBlockSignals( );299 rtThreadPosixBlockSignals(NULL); 289 300 } 290 301 … … 331 342 DECLHIDDEN(int) rtThreadNativeAdopt(PRTTHREADINT pThread) 332 343 { 333 rtThreadPosixBlockSignals( );344 rtThreadPosixBlockSignals(pThread); 334 345 335 346 int rc = pthread_setspecific(g_SelfKey, pThread); … … 367 378 #endif 368 379 369 rtThreadPosixBlockSignals( );380 rtThreadPosixBlockSignals(pThread); 370 381 371 382 /*
Note:
See TracChangeset
for help on using the changeset viewer.