discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performSelector:onThread:withObject:waitUntilDone: fails on windows


From: Samantha Rahn
Subject: performSelector:onThread:withObject:waitUntilDone: fails on windows
Date: Fri, 3 Apr 2009 15:26:01 -0400

All,
I am writing a multi-threaded program and want to use the NSObject
method performSelector:onThread:withObject:waitUntilDone: to send a
message to another thread.  I am running on windows under MINGW and I
am finding that the requested method invocation never happens.

After debugging, inside the GnuStep code in NSThread.m, I found that
the following section fails:
    - (void) addPerformer: (id)performer
    {
       [lock lock];
       [performers addObject: performer];
     #if defined(__MINGW32__)
       if (SetEvent(event) == 0)
       {
          NSLog(@"Set event failed - %@", [NSError _last]);
       }
    #else
       if (write(outputFd, "0", 1) != 1)
       {
         NSLog(@"Write to pipe failed - %@", [NSError _last]);
       }
   #endif
      [lock unlock];
   }
with error message:
   2009-04-03 19:21:58.527 Tool[1234] Set event failed - The handle is invalid.

After reading about the Windows calls CreateEvent and SetEvent, I am
finding that SetEvent will only work if the ACL security field,
EVENT_MODIFY_STATE is set.  How should this be done outside of the
code?  I have found that not only is this failing but also all
DO-related functions are not working, probably for the same reason.

Any insight into this would be appreciated.
Sam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]