Changeset 18989 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Apr 17, 2009 1:01:30 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/init.cpp
r18196 r18989 51 51 #include <iprt/string.h> 52 52 #include <iprt/param.h> 53 #include <iprt/process.h> 53 54 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 54 55 # include <iprt/file.h> … … 231 232 * The Process ID. 232 233 */ 233 #ifdef _MSC_VER 234 g_ProcessSelf = _getpid(); /* crappy ansi compiler */ 235 #else 236 g_ProcessSelf = getpid(); 237 #endif 234 /* The first call to RTProcSelf lazily initialises the cached pid, and 235 * on posix systems also sets a callback to update the cache on fork. 236 * We just do a dummy call to it here rather than duplicating 237 * initialisation code. */ 238 /** @todo since we do lazy initialisation anyway, do we really also need 239 * to do it explicitly? */ 240 RTProcSelf(); 238 241 239 242 /* -
trunk/src/VBox/Runtime/r3/process.cpp
r11836 r18989 47 47 #endif 48 48 49 #if !defined (RT_OS_OS2) && !defined(RT_OS_WINDOWS) 50 # include <pthread.h> 51 #endif 52 53 #if !defined (RT_OS_OS2) && !defined(RT_OS_WINDOWS) 54 /** Update the cached pid on fork on posix systems */ 55 static void rtProcPThreadAtFork(void) 56 { 57 g_ProcessSelf = getpid(); 58 } 59 #endif 49 60 50 61 /** … … 60 71 61 72 /* lazy init. */ 73 #if !defined (RT_OS_OS2) && !defined(RT_OS_WINDOWS) 74 /* Update the cached pid on fork on posix systems */ 75 if (pthread_atfork(NULL, NULL, rtProcPThreadAtFork) != 0) 76 return 0; 77 #endif 62 78 #ifdef _MSC_VER 63 79 Self = _getpid(); /* crappy ansi compiler */
Note:
See TracChangeset
for help on using the changeset viewer.