Ignore:
Timestamp:
Mar 18, 2018, 9:10:03 PM (7 years ago)
Author:
bird
Message:

kmk/win: Reworking child process handling. This effort will hopefully handle processor groups better and allow executing internal function off the main thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/w32/w32os.c

    r3140 r3156  
    2424#include <io.h>
    2525#include "pathstuff.h"
    26 #include "sub_proc.h"
     26#ifndef CONFIG_NEW_WIN_CHILDREN
     27# include "sub_proc.h"
     28#else
     29# include "winchildren.h"
     30#endif
    2731#include "w32err.h"
    2832#include "os.h"
     
    169173jobserver_acquire (int timeout)
    170174{
     175#ifndef CONFIG_NEW_WIN_CHILDREN
    171176    HANDLE handles[MAXIMUM_WAIT_OBJECTS + 1]; /* bird: + 1 to prevent trashing the stack. */
     177#else
     178    HANDLE handles[2];
     179#endif
    172180    DWORD dwHandleCount;
    173181    DWORD dwEvent;
     
    176184    handles[0] = jobserver_semaphore;
    177185
     186#ifndef CONFIG_NEW_WIN_CHILDREN
    178187    /* Build array of handles to wait for.  */
    179188    dwHandleCount = 1 + process_set_handles (&handles[1]);
     189#else
     190    /* Add the completed children event as the 2nd one. */
     191    handles[1] = (HANDLE)MkWinChildGetCompleteEventHandle();
     192    dwHandleCount = 2;
     193#endif
    180194
    181195    dwEvent = WaitForMultipleObjects (
Note: See TracChangeset for help on using the changeset viewer.