Commit Graph
75 Commits
Author SHA1 Message Date
Glenn Maynard b97d527d02 add EventImpl::WaitTimeoutSupported 2006-12-22 10:39:55 +00:00
Glenn Maynard 4418f202f4 update comment 2006-12-13 22:30:35 +00:00
Steve Checkoway 2250322d41 trylock 2006-12-01 18:17:16 +00:00
Glenn Maynard b77024f3bc include 2006-09-18 22:45:42 +00:00
Steve Checkoway 61739160fe Handle the new clock api "correctly." At least differentiate CLOCK_MONOTONIC and CLOCK_REALTIME. Mac OS X uses the former for timers and is forced to use the latter for the pthread functions. 2006-07-18 04:39:30 +00:00
Steve Checkoway bea4177222 Remove unneeded assert. 2006-07-18 03:57:31 +00:00
Steve Checkoway 4f8049377b The default ctor gets the time. Avoid that since we're setting it to the value of the timeval. 2006-07-18 03:53:21 +00:00
Steve Checkoway e349c58ba9 Fix compile for systems that use pthreads but don't define UNIX and don't have clockid_t defined. If necessary, this can be redone in a more general way using configure.ac. 2006-07-13 06:31:10 +00:00
Glenn Maynard 6e245f46ae use pthread_condattr_setclock to avoid race conditions with the clock 2006-07-12 01:47:10 +00:00
Glenn Maynard be5ff68d58 Fix race condition: thread->ThreadId is not necessarily assigned before
StartThread is run.
2006-04-05 06:45:03 +00:00
Glenn Maynard fcab277ec9 keep this around as a reminder; this doesn't matter for normal clocks, but it's not good for CLOCK_MONOTONIC 2006-03-23 21:45:53 +00:00
Chris Danford 96d75f8cee fix timeout value passed to pthread_cond_timedwait 2006-03-23 17:36:51 +00:00
Steve Checkoway bb1b56aed4 BSD 2006-03-20 06:52:06 +00:00
Glenn Maynard 01629e7f53 spacing 2006-02-14 11:35:00 +00:00
Steve Checkoway 3cd26abb99 Just in case these are ever implemented, fix. sem_* return -1 for all error conditions. Only sem_destroy sets errno to EBUSY anway.
Also, ASSERT so we get a backtrace.
2006-02-05 13:24:44 +00:00
Steve Checkoway 79218ae6ad Bah. Revert. The functions sem_init() and sem_destroy() are implemented as stubs only. They return -1 with errno=ENOSYS. 2006-02-05 13:21:58 +00:00
Steve Checkoway 48bf80b5f6 OS X has semaphores for every version we support (10.2.8 and on). 2006-02-05 13:00:09 +00:00
Steve Checkoway 833d06d1f3 pthread_join() returns an error code, it does not set errno. 2005-12-17 13:17:35 +00:00
Glenn Maynard d03f1ed31f cleanup 2005-12-13 01:10:48 +00:00
Steve Checkoway aa0f90feae __MACOSX__ --> MACOSX, keep __MACOSX__ for ogg. 2005-10-24 10:37:56 +00:00
Glenn Maynard 1783fe71ef simplify 2005-07-19 03:15:24 +00:00
Glenn Maynard a79f1381f3 fix casting problem? 2005-06-22 20:58:41 +00:00
Steve Checkoway 99387583f9 DARWIN -> __MACOSX__ 2005-06-21 08:56:36 +00:00
Ben Anderson d137be895e Thanks Glenn, your blatant 'it worked for me' syndrome really bit me in the ass. 2005-04-05 23:51:38 +00:00
Glenn Maynard af231d1a63 cleanup 2005-04-05 05:07:13 +00:00
Ted Percival e1ab8c5b77 fix timing errors in thread wait functions on unix. patch by makovick fixes bug #1154212 2005-03-24 19:46:50 +00:00
Glenn Maynard 23d907e3d4 remove ill-formatted comment (I feel like I've asked him to space comments
readably, like the rest of the code, half a dozen times).

The function is probably just returning ERROR_CALL_NOT_IMPLEMENTED.
If it's returning some other error, find out what it is and add it to the conditional.  Don't
just break out without understanding the logic of the rest of the function.
2005-02-12 06:21:29 +00:00
Charles Lohr 0051938177 We really shouldn't crash on systems this command is not fully supported on. Windows 9x will always respond with a 1. 2005-02-12 05:32:35 +00:00
Glenn Maynard d38fedfcaa fix thread handle leak (these don't show up as threads anywhere, but
sysinternals handle.exe shows them)
2005-02-06 10:25:13 +00:00
Glenn Maynard 46f414e7e5 Fix race condition.
Work around undocumented SignalObjectAndWait behavior; the docs
refer to "the object", but the function takes two objects.  (Cut and paste
documentation ...)
2005-01-29 20:25:52 +00:00
Glenn Maynard 8bf00eb4e8 implement event wait timeouts in win32 2005-01-27 01:54:33 +00:00
Glenn Maynard 903aaadcc5 After signalling an event, always wait for the signalled thread to touch
m_WaitersDone.  This fixes problems with

 event.Lock();
 event.Signal();
 while(x) event.Wait();

picking up the signal that it just sent (which is wrong), especially in the
debugger.
2005-01-27 01:19:24 +00:00
Glenn Maynard 1b49d06b5d oops 2005-01-26 21:41:40 +00:00
Glenn Maynard 08ddf9af77 fix up EventImpl_Pthreads::Wait 2005-01-26 21:13:50 +00:00
Glenn Maynard 63604a6536 implement RageEvent::Wait timeouts 2005-01-26 20:59:41 +00:00
Glenn Maynard 0330fa9e87 untested pthreads event implementation 2004-11-07 22:56:03 +00:00
Glenn Maynard 4de15ff3a7 untested thread events implementation for win32 2004-11-07 22:43:39 +00:00
Chris Danford 79beff5e26 revert timeout length 2004-10-09 16:56:29 +00:00
Chris Danford 47e2e2d48d increase mutex timeout 2004-10-09 09:00:24 +00:00
Glenn Maynard 00b2d18a8e show thread names in the VC debugger 2004-09-17 02:36:04 +00:00
Glenn Maynard fefe7bad49 fix thread handles on win9x 2004-09-14 04:39:52 +00:00
Glenn Maynard 34f22e588c fix up SemaImpl_Pthreads::Wait 2004-09-08 21:58:47 +00:00
Glenn Maynard 3e7f55ae30 no, don't use pthreads extensions if we don't at least have timedlock (not going to bother making it two tests unless it's actually needed) 2004-09-08 08:56:19 +00:00
Steve Checkoway bf3ce581af OS X has pthread_cond_timedwait but not pthread_mutex_timedlock. 2004-09-08 08:36:43 +00:00
Glenn Maynard 2625da14f2 cleanup
support semaphore timeouts
2004-09-08 07:56:32 +00:00
Glenn Maynard 81f2f6460a hopefully fix init order in vc6 2004-09-08 06:33:07 +00:00
Steve Checkoway bdd4988829 Simplify. 2004-09-07 12:49:49 +00:00
Steve Checkoway 8adbeda32a Use DarwinThreadHelpers, remove mach stuff. 2004-09-07 12:38:10 +00:00
Glenn Maynard 9cf85e4b84 remove comment 2004-09-07 04:24:26 +00:00
Glenn Maynard 7f805dcc87 simplify 2004-09-07 03:26:23 +00:00