diff options
-rw-r--r-- | ANNOUNCE | 6 | ||||
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | FAQ | 40 | ||||
-rw-r--r-- | condvar.c | 5 | ||||
-rw-r--r-- | pthread.def | 6 | ||||
-rw-r--r-- | semaphore.c | 33 | ||||
-rw-r--r-- | semaphore.h | 19 | ||||
-rw-r--r-- | tests/ChangeLog | 14 | ||||
-rw-r--r-- | tests/Makefile | 5 | ||||
-rw-r--r-- | tests/runall.bat | 2 |
10 files changed, 141 insertions, 7 deletions
@@ -1,5 +1,5 @@ - PTHREADS-WIN32 SNAPSHOT 1999-04-07 + PTHREADS-WIN32 SNAPSHOT 1999-05-08 ---------------------------------- Web Site: http://sourceware.cygnus.com/pthreads-win32/ FTP Site: ftp://sourceware.cygnus.com/pub/pthreads-win32 @@ -133,6 +133,10 @@ The following functions are implemented: sem_post (POSIX 1b) sem_wait (POSIX 1b) sem_trywait (POSIX 1b) + sem_open (POSIX 1b - returns an error) + sem_close (POSIX 1b - returns an error) + sem_unlink (POSIX 1b - returns an error) + sem_getvalue (POSIX 1b - returns an error) --------------------------- RealTime Scheduling @@ -15,6 +15,24 @@ Fri May 14 12:13:18 1999 Ross Johnson <rpj@swan.canberra.edu.au> * attr.c (pthread_attr_setdetachstate): Fix logic bug - Mike Russo <miker@eai.com>. +Sat May 8 09:42:30 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> + + * pthread.def (sem_open): Add. + (sem_close): Add. + (sem_unlink): Add. + (sem_getvalue): Add. + + * FAQ (Question 3): Add. + +Thu Apr 8 01:16:23 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> + + * semaphore.c (sem_open): New function; returns an error (ENOSYS). + (sem_close): ditto. + (sem_unlink): ditto. + (sem_getvalue): ditto. + + * semaphore.h (_POSIX_SEMAPHORES): define. + Wed Apr 7 14:09:52 1999 Ross Johnson <rpj@swan.canberra.edu.au> * errno.c (_REENTRANT || _MT): Invert condition. @@ -10,6 +10,8 @@ Q 1 Should I use Cygwin or Mingw32 as a development environment? Q 2 Now that pthreads-win32 builds under Mingw32, why do I get memory access violations? +Q 3 How do I use pthread.dll for Win32 (Visual C++ 5.0) + ============================================================================= Q 1 Should I use Cygwin or Mingw32 as a development environment? @@ -137,3 +139,41 @@ able to tackle it myself. Kevin +------------------------------------------------------------------------------ + +Q 3 How do I use pthread.dll for Win32 (Visual C++ 5.0) +--- + +A 3 +--- +> +> I'm a "rookie" when it comes to your pthread implementation. I'm currently +> desperately trying to install the prebuilt .dll file into my MSVC compiler. +> Could you please provide me with explicit instructions on how to do this (or +> direct me to a resource(s) where I can acquire such information)? +> +> Thank you, +> + +You should have a .dll, .lib, .def, and three .h files. + +The .dll can go in any directory listed in your PATH environment +variable, so putting it into C:\WINDOWS should work. + +The .lib file can go in any directory listed in your LIB environment +variable. + +The .h files can go in any directory listed in your INCLUDE +environment variable. + +Or you might prefer to put the .lib and .h files into a new directory +and add its path to LIB and INCLUDE. You can probably do this easiest +by editing the file:- + +C:\Program Files\DevStudio\vc\bin\vcvars32.bat + +The .def file isn't used by anything in the pre-compiled version but +is included for information. + +Cheers. +Ross @@ -817,7 +817,6 @@ pthread_cond_broadcast (pthread_cond_t * cond) */ { int result = 0; - int i; pthread_cond_t cv; if (cond == NULL || *cond == NULL) @@ -840,7 +839,7 @@ pthread_cond_broadcast (pthread_cond_t * cond) /* * Wake up all waiters */ - result = (ReleaseSemaphore( cv->sema, cond->waiters, NULL ) + result = (ReleaseSemaphore( cv->sema, cv->waiters, NULL ) ? 0 : EINVAL); @@ -865,5 +864,3 @@ pthread_cond_broadcast (pthread_cond_t * cond) return (result); } - - diff --git a/pthread.def b/pthread.def index 1039497..b7d1ce9 100644 --- a/pthread.def +++ b/pthread.def @@ -1,5 +1,5 @@ ; pthread.def -; Last updated: $Date: 1999/04/03 22:05:47 $ +; Last updated: $Date: 1999/05/29 06:44:34 $ ; Currently unimplemented functions are commented out. @@ -83,6 +83,10 @@ sem_destroy sem_trywait sem_wait sem_post +sem_open +sem_close +sem_unlink +sem_getvalue ; ; Non-portable but useful ; diff --git a/semaphore.c b/semaphore.c index cd463d3..0fcfc94 100644 --- a/semaphore.c +++ b/semaphore.c @@ -329,3 +329,36 @@ sem_post (sem_t * sem) return 0; } /* sem_post */ + + +int +sem_open (const char * name, int oflag, mode_t mode, unsigned int value) +{ + errno = ENOSYS; + return -1; +} /* sem_open */ + + +int +sem_close (sem_t * sem) +{ + errno = ENOSYS; + return -1; +} /* sem_close */ + + +int +sem_unlink (const char * name) +{ + errno = ENOSYS; + return -1; +} /* sem_unlink */ + + +int +sem_getvalue (sem_t * sem, int * sval) +{ + errno = ENOSYS; + return -1; +} /* sem_getvalue */ + diff --git a/semaphore.h b/semaphore.h index f5d9c83..e05cc4a 100644 --- a/semaphore.h +++ b/semaphore.h @@ -31,11 +31,15 @@ #include <process.h> #include <errno.h> +#define _POSIX_SEMAPHORES + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +typedef unsigned int mode_t; + typedef HANDLE sem_t; int sem_init (sem_t * sem, @@ -55,6 +59,21 @@ int sem_wait (sem_t * sem int sem_post (sem_t * sem ); +int sem_open (const char * name, + int oflag, + ... + ); + +int sem_close (sem_t * sem + ); + +int sem_unlink (const char * name + ); + +int sem_getvalue (sem_t * sem, + int * sval + ); + #ifdef __cplusplus } /* End of extern "C" */ #endif /* __cplusplus */ diff --git a/tests/ChangeLog b/tests/ChangeLog index e0969ef..22b7028 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,17 @@ +Sat May 29 23:29:04 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> + + * runall.bat (condvar5): Add new test. + + * runall.bat (condvar6): Add new test. + + * Makefile (condvar5) : Add new test. + + * Makefile (condvar6) : Add new test. + + * condvar5.c: New test for pthread_cond_broadcast(). + + * condvar6.c: New test for pthread_cond_broadcast(). + Sun Apr 4 12:04:28 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * tsd1.c (mythread): Change Sleep(0) to sched_yield(). diff --git a/tests/Makefile b/tests/Makefile index 21309e5..f96d830 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -39,7 +39,8 @@ TESTS = mutex1 condvar1 condvar2 exit1 create1 equal1 \ exit2 exit3 \ join1 mutex2 mutex3 \ count1 once1 tsd1 self1 self2 eyal1 \ - condvar3 condvar4 errno1 + condvar3 condvar4 condvar5 condvar6 \ + errno1 PASSES = $(TESTS:%=%.pass) @@ -65,6 +66,8 @@ self2.pass: create1.pass eyal1.pass: tsd1.pass condvar3.pass: create1.pass condvar4.pass: create1.pass +condvar5.pass: condvar4.pass +condvar6.pass: condvar5.pass errno1.pass: mutex3.pass %.pass: %.exe $(LIB) $(DLL) $(HDR) diff --git a/tests/runall.bat b/tests/runall.bat index f061f3a..0e3801b 100644 --- a/tests/runall.bat +++ b/tests/runall.bat @@ -21,4 +21,6 @@ call runtest cl self2 call runtest cl eyal1 call runtest cl condvar3 call runtest cl condvar4 +call runtest cl condvar5 +call runtest cl condvar6 call runtest cl errno1 |