-void SimpleThread::sleep(int32_t millis)
-{
- ::Sleep(millis);
-}
-
-//-----------------------------------------------------------------------------------
-//
-// class SimpleThread NULL Implementation
-//
-//-----------------------------------------------------------------------------------
-#elif U_PLATFORM == U_PF_CLASSIC_MACOS
-
-// since the Mac has no preemptive threading (at least on MacOS 8), only
-// cooperative threading, threads are a no-op. We have no yield() calls
-// anywhere in the ICU, so we are guaranteed to be thread-safe.
-
-#define HAVE_IMP
-
-SimpleThread::SimpleThread()
-{}
-
-SimpleThread::~SimpleThread()
-{}
-
-int32_t
-SimpleThread::start()
-{ return 0; }
-
-void
-SimpleThread::run()
-{}
-
-void
-SimpleThread::sleep(int32_t millis)
-{}
-
-UBool
-SimpleThread::isRunning() {
- return FALSE;
-}
-
-#endif
-
-
-//-----------------------------------------------------------------------------------
-//
-// class SimpleThread POSIX implementation
-//
-// A note on the POSIX vs the Windows implementations of this class..
-// On Windows, the main thread must verify that other threads have finished
-// before exiting, or crashes occasionally occur. (Seen on Itanium Win64 only)
-// The function SimpleThread::isRunning() is used for this purpose.
-//
-// On POSIX, there is NO reliable non-blocking mechanism to determine
-// whether a thread has exited. pthread_kill(thread, 0) almost works,
-// but the system can recycle thread ids immediately, so seeing that a
-// thread exists with this call could mean that the original thread has
-// finished and a new one started with the same ID. Useless.
-//
-// So we need to do the check with user code, by setting a flag just before
-// the thread function returns. A technique that is guaranteed to fail
-// on Windows, because it indicates that the thread is done before all
-// system level cleanup has happened.
-//
-//-----------------------------------------------------------------------------------
-#if defined(POSIX)
-#define HAVE_IMP
-
-struct PosixThreadImplementation
-{
- pthread_t fThread;
- UBool fRunning;
- UBool fRan; // True if the thread was successfully started