Home | C-Bits Package Documentation | Project Page |
00001 /* ==================================================================== 00002 * The CBITS Software License, Version 1.0 00003 * 00004 * Copyright (c) 2002-2003 Bruce Lowery 00005 * All rights reserved 00006 * 00007 * Redistribution and use of this software, in source and binary forms, 00008 * with or without modification, are permitted provided that the above 00009 * copyright notice, this paragraph, and the following paragraph are 00010 * retained in each source code file. 00011 * 00012 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00013 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00014 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00015 * DISCLAIMED. IN NO EVENT SHALL BRUCE LOWERY OR OTHER CONTRIBUTORS 00016 * TO THE CBITS LIBRARY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00017 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00018 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00019 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00020 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00021 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00022 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00023 * SUCH DAMAGE. 00024 * ==================================================================== 00025 */ 00026 #ifndef __THREAD_WIN32_H__ 00027 #define __THREAD_WIN32_H__ 00028 00029 #include <cbits/Runnable.h> 00030 #include <cbits/Thread.h> 00031 00032 00033 #ifdef BUILD_DLL 00034 #define EXPORT __declspec(dllexport) 00035 #else 00036 #define EXPORT 00037 #endif 00038 00039 00040 namespace cbits 00041 { 00042 00047 class EXPORT Thread_WIN32 : public virtual Thread 00048 { 00049 00050 public: 00051 Thread_WIN32( Runnable* r, const Priority p = DEFAULT_PRIORITY ); 00052 00053 static Thread* get_current_thread(); 00054 static void yield(); 00055 00056 virtual ~Thread_WIN32(); 00057 00058 00059 protected: 00060 static void* run_thread( void * ); 00061 00062 virtual const bool impl_create_thread( const Priority ); 00063 virtual const bool impl_start_thread(); 00064 virtual const long impl_get_threadid() const; 00065 virtual void impl_lock_obj() const; 00066 virtual void impl_unlock_obj() const; 00067 virtual void impl_interrupt(); 00068 virtual const bool impl_join( const long msec ); 00069 virtual void impl_sleep( const long msec ); 00070 00071 private: 00072 00073 const long getTid() const; 00074 #ifdef WIN32 00075 #endif 00076 00077 }; /* END OF CLASS Thread_WIN32 */ 00078 00079 00080 }; /* END OF NAMESPACE cbits */ 00081 00082 #endif 00083 00084 /* 00085 * $Id: Thread_WIN32.h,v 1.5 2002/10/06 04:13:01 brulow Exp $ 00086 * 00087 * History: (Add nothing manually below) 00088 * ----------------------------------------------------------------------- 00089 * 00090 * $Log: Thread_WIN32.h,v $ 00091 * Revision 1.5 2002/10/06 04:13:01 brulow 00092 * Add unit thread pkg unit tests and fix thread pkg bugs. 00093 * 00094 * Revision 1.4 2002/10/05 15:48:50 brulow 00095 * Add 'sleep' to Thread interface; 00096 * Add synchronization between creator and new thread. 00097 * 00098 * Revision 1.3 2002/10/04 03:02:17 brulow 00099 * Fix 'undefined virtual table' problem in ResourceLock_XX classes 00100 * 00101 * Revision 1.2 2002/10/03 15:09:23 brulow 00102 * Add footer 00103 * 00104 * 00105 */
|
|