From gibbsjoseph@example.org Sat Sep 01 07:11:50 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 52841 invoked by uid 500); 1 Sep 2001 07:11:49 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 52830 invoked from network); 1 Sep 2001 07:11:49 -0000 Date: 1 Sep 2001 07:10:25 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/win32 thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 00:10:25 Modified: threadproc/win32 thread.c Log: It helps to assign it to the correct level of indirection Revision Changes Path 1.37 +1 -1 apr/threadproc/win32/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/win32/thread.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- thread.c 2001/09/01 05:10:23 1.36 +++ thread.c 2001/09/01 07:10:25 1.37 @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - control = apr_pcalloc(p, sizeof(**control)); + (*control) = apr_pcalloc(p, sizeof(**control)); return APR_SUCCESS; } From gibbsjoseph@example.org Sat Sep 01 07:15:01 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 53286 invoked by uid 500); 1 Sep 2001 07:15:01 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 53275 invoked from network); 1 Sep 2001 07:15:01 -0000 Date: 1 Sep 2001 07:13:37 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/test testthread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 00:13:37 Modified: test testthread.c Log: After fighting the test build system on Windows for a while, this is a test for apr_thread_once that works on Windows. I'll check it on Unix in a few minutes. Revision Changes Path 1.23 +32 -0 apr/test/testthread.c Index: testthread.c =================================================================== RCS file: /home/cvs/apr/test/testthread.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- testthread.c 2001/08/22 15:40:29 1.22 +++ testthread.c 2001/09/01 07:13:37 1.23 @@ -81,12 +81,22 @@ apr_lock_t *thread_lock; apr_pool_t *context; +apr_thread_once_t *control = NULL; int x = 0; +int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ +void init_func(void) +{ + value++; +} + void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -99,6 +109,9 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -111,6 +124,9 @@ void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -123,6 +139,9 @@ void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -153,6 +172,8 @@ } fprintf(stdout, "OK\n"); + apr_thread_once_init(&control, context); + fprintf(stdout, "Initializing the lock......."); s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { @@ -201,6 +222,17 @@ } else { fprintf(stdout, "Everything is working!\n"); + } + + fprintf(stdout, "Checking if apr_thread_once worked......."); + if (value != 1) { + fflush(stdout); + fprintf(stderr, "apr_thread_once must not have worked, " + "value is %d\n", value); + exit(-1); + } + else { + fprintf(stdout, "apr_thread_once worked\n"); } return 0; } From gibbsjoseph@example.org Sat Sep 01 07:30:32 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 56920 invoked by uid 500); 1 Sep 2001 07:30:31 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 56909 invoked from network); 1 Sep 2001 07:30:31 -0000 Date: 1 Sep 2001 07:29:07 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/win32 thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 00:29:07 Modified: threadproc/win32 thread.c Log: Avoid a rather nasty bug in the Windows apr_thread_once function. We basically, check the value before we increment, and after. By checking before, we take a hit of one if statement, but avoid a kernel call in most cases. Submitted by: Will Rowe <gibbsjoseph@example.org> Revision Changes Path 1.38 +11 -0 apr/threadproc/win32/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/win32/thread.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- thread.c 2001/09/01 07:10:25 1.37 +++ thread.c 2001/09/01 07:29:07 1.38 @@ -231,6 +231,17 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { + /* Quick escape hatch, and bug fix. The InterlockedIncrement + * call is just incrementing a long int, so it has the potential + * to wrap. Very unlikely, but still, that would be an almost + * impossible bug to hunt. With this, we might see one or two + * calls to InterlockedIncrement, but never enough to wrap the + * long int. This also saves us a kernel call for most calls to + * this function. + */ + if (control->value) { + return APR_SUCCESS; + } InterlockedIncrement(&control->value); if (control->value == 1) { func(); From gibbsjoseph@example.org Sat Sep 01 16:50:34 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 76584 invoked by uid 500); 1 Sep 2001 16:50:33 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 76573 invoked from network); 1 Sep 2001 16:50:33 -0000 Date: 1 Sep 2001 16:48:58 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/win32 thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 09:48:58 Modified: threadproc/win32 thread.c Log: One more iteration on apr_thread_once on Windows. Now we use InterlockedExchange, and we don't have the wrapping problem, so we can also remove the quick escape hatch. Submitted by: Sander Striker <gibbsjoseph@example.org> Revision Changes Path 1.39 +1 -13 apr/threadproc/win32/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/win32/thread.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- thread.c 2001/09/01 07:29:07 1.38 +++ thread.c 2001/09/01 16:48:58 1.39 @@ -231,19 +231,7 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { - /* Quick escape hatch, and bug fix. The InterlockedIncrement - * call is just incrementing a long int, so it has the potential - * to wrap. Very unlikely, but still, that would be an almost - * impossible bug to hunt. With this, we might see one or two - * calls to InterlockedIncrement, but never enough to wrap the - * long int. This also saves us a kernel call for most calls to - * this function. - */ - if (control->value) { - return APR_SUCCESS; - } - InterlockedIncrement(&control->value); - if (control->value == 1) { + if (!InterlockedExchange(&control->value, 1)) { func(); } return APR_SUCCESS; From gibbsjoseph@example.org Sun Sep 02 03:42:55 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 97353 invoked by uid 500); 2 Sep 2001 03:42:54 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 97342 invoked from network); 2 Sep 2001 03:42:54 -0000 Date: 2 Sep 2001 03:41:17 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/test testthread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 20:41:17 Modified: test testthread.c Log: Quiet a warning on Unix. Revision Changes Path 1.24 +1 -1 apr/test/testthread.c Index: testthread.c =================================================================== RCS file: /home/cvs/apr/test/testthread.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- testthread.c 2001/09/01 07:13:37 1.23 +++ testthread.c 2001/09/02 03:41:17 1.24 @@ -86,7 +86,7 @@ int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -void init_func(void) +static void init_func(void) { value++; } From gibbsjoseph@example.org Sun Sep 02 03:46:14 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 98940 invoked by uid 500); 2 Sep 2001 03:46:14 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 98929 invoked from network); 2 Sep 2001 03:46:14 -0000 Date: 2 Sep 2001 03:44:37 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/unix thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/01 20:44:37 Modified: threadproc/unix thread.c Log: Fix a seg-fault on Unix. It helps to allocate the structure before we try to use it. Revision Changes Path 1.48 +1 -0 apr/threadproc/unix/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/unix/thread.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- thread.c 2001/08/27 10:48:05 1.47 +++ thread.c 2001/09/02 03:44:37 1.48 @@ -260,6 +260,7 @@ { static const pthread_once_t once_init = PTHREAD_ONCE_INIT; + *control = apr_palloc(p, sizeof(**control)); (*control)->once = once_init; return APR_SUCCESS; } From gibbsjoseph@example.org Sun Sep 02 05:12:18 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 33894 invoked by uid 500); 2 Sep 2001 05:12:18 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 33883 invoked from network); 2 Sep 2001 05:12:18 -0000 Date: 2 Sep 2001 05:10:41 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/file_io/win32 filesys.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bjh 01/09/01 22:10:41 Modified: file_io/os2 filesys.c file_io/win32 filesys.c Log: A couple of fixes for the c_is_fnchar map - " was off by 1 - / should be 0 Revision Changes Path 1.2 +4 -4 apr/file_io/os2/filesys.c Index: filesys.c =================================================================== RCS file: /home/cvs/apr/file_io/os2/filesys.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- filesys.c 2001/09/01 05:06:26 1.1 +++ filesys.c 2001/09/02 05:10:41 1.2 @@ -72,13 +72,13 @@ const char c_is_fnchar[256] = {/* Reject all ctrl codes... */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - /* " * / : < > ? */ - 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* " * / : < > ? */ + 1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, /* \ */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* : | */ + /* | */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ + /* High bit codes are accepted */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1.2 +3 -3 apr/file_io/win32/filesys.c Index: filesys.c =================================================================== RCS file: /home/cvs/apr/file_io/win32/filesys.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- filesys.c 2001/08/28 21:45:04 1.1 +++ filesys.c 2001/09/02 05:10:41 1.2 @@ -79,11 +79,11 @@ const char c_is_fnchar[256] = {/* Reject all ctrl codes... */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - /* " * / : < > ? */ - 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* " * / : < > ? */ + 1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, /* \ */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* : | */ + /* | */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, From gibbsjoseph@example.org Sun Sep 02 05:22:26 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 35489 invoked by uid 500); 2 Sep 2001 05:22:26 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 35478 invoked from network); 2 Sep 2001 05:22:26 -0000 Date: 2 Sep 2001 05:20:49 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/os2 thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bjh 01/09/01 22:20:49 Modified: threadproc/os2 thread.c Log: OS/2: Implement apr_thread_once(). Avoids a race condition by using an OS/2 event semaphore, created in the posted state so that the first (and only the first) thread to reset it receives a post count of 1. Revision Changes Path 1.28 +17 -2 apr/threadproc/os2/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/os2/thread.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- thread.c 2001/08/31 06:49:54 1.27 +++ thread.c 2001/09/02 05:20:49 1.28 @@ -245,11 +245,26 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - return APR_ENOTIMPL; + ULONG rc; + *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); + rc = DosCreateEventSem(NULL, &(*control)->sem, 0, TRUE); + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { - return APR_ENOTIMPL; + if (!control->hit) { + ULONG count, rc; + rc = DosResetEventSem(control->sem, &count); + + if (rc == 0 && count) { + control->hit = 1; + func(); + } + } + + return APR_SUCCESS; } From gibbsjoseph@example.org Sun Sep 02 05:36:33 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 41704 invoked by uid 500); 2 Sep 2001 05:36:32 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 41693 invoked from network); 2 Sep 2001 05:36:32 -0000 Date: 2 Sep 2001 05:34:55 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/threadproc/os2 thread.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bjh 01/09/01 22:34:55 Modified: threadproc/os2 thread.c Log: Clean up the event sem in the apr_thread_once_t. Revision Changes Path 1.29 +14 -0 apr/threadproc/os2/thread.c Index: thread.c =================================================================== RCS file: /home/cvs/apr/threadproc/os2/thread.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- thread.c 2001/09/02 05:20:49 1.28 +++ thread.c 2001/09/02 05:34:55 1.29 @@ -242,12 +242,26 @@ +static apr_status_t thread_once_cleanup(void *vcontrol) +{ + apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; + + if (control->sem) { + DosCloseEventSem(control->sem); + } + + return APR_SUCCESS; +} + + + APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { ULONG rc; *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); rc = DosCreateEventSem(NULL, &(*control)->sem, 0, TRUE); + apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); return APR_FROM_OS_ERROR(rc); } From gibbsjoseph@example.org Sun Sep 02 05:46:21 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 45266 invoked by uid 500); 2 Sep 2001 05:46:20 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 45251 invoked from network); 2 Sep 2001 05:46:20 -0000 Date: 2 Sep 2001 05:44:43 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/include/arch/os2 threadproc.h X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bjh 01/09/01 22:44:43 Modified: include/arch/os2 threadproc.h Log: OS/2: Define apr_thread_once_t Revision Changes Path 1.12 +5 -0 apr/include/arch/os2/threadproc.h Index: threadproc.h =================================================================== RCS file: /home/cvs/apr/include/arch/os2/threadproc.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- threadproc.h 2001/08/31 06:48:09 1.11 +++ threadproc.h 2001/09/02 05:44:43 1.12 @@ -95,5 +95,10 @@ apr_int32_t detached; }; +struct apr_thread_once_t { + unsigned long sem; + char hit; +}; + #endif /* ! THREAD_PROC_H */ From gibbsjoseph@example.org Sun Sep 02 18:13:25 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 2439 invoked by uid 500); 2 Sep 2001 18:13:25 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 2428 invoked from network); 2 Sep 2001 18:13:24 -0000 Date: 2 Sep 2001 18:11:33 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/memory/unix apr_pools.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jerenkrantz 01/09/02 11:11:33 Modified: memory/unix apr_pools.c Log: The spawn_mutex is a leftover from 1.3. Remove it. Justin thinks that the functionality that this did in 1.3 has been moved to threadproc. Submitted by: Aaron Bannert <gibbsjoseph@example.org> Reviewed by: Justin Erenkrantz Revision Changes Path 1.109 +0 -8 apr/memory/unix/apr_pools.c Index: apr_pools.c =================================================================== RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 --- apr_pools.c 2001/08/13 04:20:19 1.108 +++ apr_pools.c 2001/09/02 18:11:33 1.109 @@ -252,7 +252,6 @@ #if APR_HAS_THREADS static apr_lock_t *alloc_mutex; -static apr_lock_t *spawn_mutex; #endif #ifdef APR_POOL_DEBUG @@ -830,11 +829,6 @@ if (status != APR_SUCCESS) { return status; } - status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, globalp); - if (status != APR_SUCCESS) { - return status; - } #endif permanent_pool = globalp; @@ -849,9 +843,7 @@ { #if APR_HAS_THREADS apr_lock_destroy(alloc_mutex); - apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; - spawn_mutex = NULL; #endif apr_pool_destroy(globalp); } From gibbsjoseph@example.org Mon Sep 03 22:02:46 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 24542 invoked by uid 500); 3 Sep 2001 22:02:46 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 24531 invoked by uid 500); 3 Sep 2001 22:02:45 -0000 Delivered-To: gibbsjoseph@example.org Date: 3 Sep 2001 22:00:37 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr-util/buckets apr_brigade.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jwoolley 01/09/03 15:00:36 Modified: buckets apr_brigade.c Log: fix typo Revision Changes Path 1.25 +4 -4 apr-util/buckets/apr_brigade.c Index: apr_brigade.c =================================================================== RCS file: /home/cvs/apr-util/buckets/apr_brigade.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -u -r1.24 -r1.25 --- apr_brigade.c 2001/08/26 03:15:37 1.24 +++ apr_brigade.c 2001/09/03 22:00:36 1.25 @@ -384,7 +384,7 @@ return rv; } -struct bridgade_vprintf_data_t { +struct brigade_vprintf_data_t { apr_vformatter_buff_t vbuff; apr_bucket_brigade *b; /* associated brigade */ @@ -401,8 +401,8 @@ * buff.curpos > buff.endpos */ - /* "downcast," have really passed a bridgade_vprintf_data_t* */ - struct bridgade_vprintf_data_t *vd = (struct bridgade_vprintf_data_t*)buff; + /* "downcast," have really passed a brigade_vprintf_data_t* */ + struct brigade_vprintf_data_t *vd = (struct brigade_vprintf_data_t*)buff; apr_status_t res = APR_SUCCESS; res = apr_brigade_write(vd->b, *vd->flusher, vd->ctx, vd->cbuff, @@ -424,7 +424,7 @@ const char *fmt, va_list va) { /* the cast, in order of appearance */ - struct bridgade_vprintf_data_t vd; + struct brigade_vprintf_data_t vd; char buf[APR_BUCKET_BUFF_SIZE]; apr_size_t written; From gibbsjoseph@example.org Tue Sep 04 21:23:22 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 84075 invoked by uid 500); 4 Sep 2001 21:23:22 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 84038 invoked from network); 4 Sep 2001 21:23:21 -0000 Date: 4 Sep 2001 21:20:57 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/misc/unix errorcodes.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N wrowe 01/09/04 14:20:57 Modified: dso/win32 dso.c misc/unix errorcodes.c Log: Some message is better than no message. Modified the lookup to show %n substitutions untranslated, and return real (viewable) error code from DSO load failure, both for Win32. Revision Changes Path 1.23 +16 -13 apr/dso/win32/dso.c Index: dso.c =================================================================== RCS file: /home/cvs/apr/dso/win32/dso.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- dso.c 2001/08/02 03:15:56 1.22 +++ dso.c 2001/09/04 21:20:57 1.23 @@ -75,6 +75,7 @@ const char *path, apr_pool_t *ctx) { HINSTANCE os_handle; + apr_status_t rv; UINT em; #if APR_HAS_UNICODE_FS @@ -82,16 +83,19 @@ if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { - return rv; + if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) + != APR_SUCCESS) { + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + return ((*res_handle)->load_error = rv); } /* Prevent ugly popups from killing our app */ em = SetErrorMode(SEM_FAILCRITICALERRORS); os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, 0); + if (!os_handle) + rv = apr_get_os_error(); SetErrorMode(em); } else @@ -105,7 +109,7 @@ * that backslashes must be used for the LoadLibrary family of calls. */ apr_cpystrn(fspec, path, sizeof(fspec)); - while (p = strchr(p, '/')) + while ((p = strchr(p, '/')) != NULL) *p = '\\'; /* Prevent ugly popups from killing our app */ @@ -113,13 +117,14 @@ os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) os_handle = LoadLibraryEx(path, NULL, 0); + if (!os_handle) + rv = apr_get_os_error(); SetErrorMode(em); } *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); - if(os_handle == NULL) { - (*res_handle)->load_error = apr_get_os_error(); - return (*res_handle)->load_error; + if (rv) { + return ((*res_handle)->load_error = rv); } (*res_handle)->handle = (void*)os_handle; @@ -140,13 +145,11 @@ struct apr_dso_handle_t *handle, const char *symname) { - FARPROC retval = GetProcAddress(handle->handle, symname); - if (!retval) { + *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); + + if (!*ressym) { return apr_get_os_error(); } - - *ressym = retval; - return APR_SUCCESS; } 1.43 +3 -2 apr/misc/unix/errorcodes.c Index: errorcodes.c =================================================================== RCS file: /home/cvs/apr/misc/unix/errorcodes.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- errorcodes.c 2001/08/29 15:20:24 1.42 +++ errorcodes.c 2001/09/04 21:20:57 1.43 @@ -279,7 +279,8 @@ apr_size_t len=0, i; #ifndef NETWARE - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ @@ -315,7 +316,7 @@ else { /* Windows didn't provide us with a message. Even stuff like * WSAECONNREFUSED won't get a message. */ - apr_cpystrn(buf, "Unrecognized error code", bufsize); + apr_snprintf(buf, bufsize, "Unrecognized Win32 error code %d", errcode); } return buf; From gibbsjoseph@example.org Tue Sep 04 22:57:23 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 26666 invoked by uid 500); 4 Sep 2001 22:57:23 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 26640 invoked from network); 4 Sep 2001 22:57:22 -0000 Date: 4 Sep 2001 22:54:58 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/file_io/unix dir.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/04 15:54:58 Modified: file_io/unix dir.c Log: apr_dir_read (with something like APR_FINFO_TYPE in wanted) will return APR_INCOMPLETE if it encounters a broken symlink... bug or feature? I say bug... the caller can quite happily cope with symlinks, broken or not, as they wish, they just wanted to know what is in the directory. Submitted by: Joe Orton <gibbsjoseph@example.org> Revision Changes Path 1.57 +1 -2 apr/file_io/unix/dir.c Index: dir.c =================================================================== RCS file: /home/cvs/apr/file_io/unix/dir.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- dir.c 2001/06/15 20:04:43 1.56 +++ dir.c 2001/09/04 22:54:58 1.57 @@ -160,8 +160,7 @@ if (fspec[off - 1] != '/') fspec[off++] = '/'; apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - /* ??? Or lstat below? What is it we really want? */ - ret = apr_stat(finfo, fspec, wanted, thedir->cntxt); + ret = apr_lstat(finfo, fspec, wanted, thedir->cntxt); } if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { From gibbsjoseph@example.org Tue Sep 04 23:31:16 2001 Return-Path: <gibbsjoseph@example.org> Delivered-To: gibbsjoseph@example.org Received: (qmail 88453 invoked by uid 500); 4 Sep 2001 23:31:15 -0000 Mailing-List: contact gibbsjoseph@example.org; run by ezmlm Precedence: bulk List-Post: <mailto:gibbsjoseph@example.org> List-Help: <mailto:gibbsjoseph@example.org> List-Unsubscribe: <mailto:gibbsjoseph@example.org> List-Subscribe: <mailto:gibbsjoseph@example.org> Reply-To: gibbsjoseph@example.org Delivered-To: mailing list gibbsjoseph@example.org Received: (qmail 88438 invoked from network); 4 Sep 2001 23:31:15 -0000 Date: 4 Sep 2001 23:28:51 -0000 Message-ID: <gibbsjoseph@example.org> From: gibbsjoseph@example.org To: gibbsjoseph@example.org Subject: cvs commit: apr/locks/win32 thread_mutex.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N rbb 01/09/04 16:28:51 Modified: locks/beos Makefile.in locks/os2 Makefile.in locks/unix Makefile.in Added: include apr_thread_mutex.h include/arch/beos thread_mutex.h include/arch/netware thread_mutex.h include/arch/os2 thread_mutex.h include/arch/unix thread_mutex.h include/arch/win32 thread_mutex.h locks/beos thread_mutex.c locks/netware thread_mutex.c locks/os2 thread_mutex.c locks/unix thread_mutex.c locks/win32 thread_mutex.c Log: Add the new thread_lock API to APR. This is the first step to breaking the locking API into separate APIs. Submitted by: Aaron Bannert <gibbsjoseph@example.org> Revision Changes Path 1.1 apr/include/apr_thread_mutex.h Index: apr_thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef APR_THREAD_MUTEX_H #define APR_THREAD_MUTEX_H #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file apr_thread_mutex.h * @brief APR Thread Mutex Routines */ /** * @defgroup APR_ThreadMutex Thread Mutex Routines * @ingroup APR * @{ */ typedef struct apr_thread_mutex_t apr_thread_mutex_t; /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be * stored. * @param pool the pool from which to allocate the mutex. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_MUTEX_H */ 1.1 apr/include/arch/beos/thread_mutex.h Index: thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include <kernel/OS.h> #include "apr_pools.h" #include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" struct apr_thread_mutex_t { apr_pool_t *pool; }; #endif /* THREAD_MUTEX_H */ 1.1 apr/include/arch/netware/thread_mutex.h Index: thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_thread_mutex.h" #include <nks/synch.h> struct apr_thread_mutex_t { apr_pool_t *pool; }; #endif /* THREAD_MUTEX_H */ 1.1 apr/include/arch/os2/thread_mutex.h Index: thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_thread_mutex.h" #include "apr_file_io.h" struct apr_thread_mutex_t { apr_pool_t *pool; }; #endif /* THREAD_MUTEX_H */ 1.1 apr/include/arch/unix/thread_mutex.h Index: thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_thread_mutex.h" #include "apr_sms.h" #include "apr_portable.h" #if APR_HAVE_PTHREAD_H #include <pthread.h> #endif /* End System Headers */ #if APR_HAS_THREADS struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; apr_os_thread_t owner; int owner_ref; }; #endif #endif /* THREAD_MUTEX_H */ 1.1 apr/include/arch/win32/thread_mutex.h Index: thread_mutex.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_lock.h" struct apr_thread_mutex_t { apr_pool_t *pool; }; #endif /* THREAD_MUTEX_H */ 1.13 +2 -1 apr/locks/beos/Makefile.in Index: Makefile.in =================================================================== RCS file: /home/cvs/apr/locks/beos/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Makefile.in 2001/06/11 11:33:33 1.12 +++ Makefile.in 2001/09/04 23:28:51 1.13 @@ -1,5 +1,6 @@ -TARGETS = locks.lo +TARGETS = locks.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ 1.1 apr/locks/beos/thread_mutex.c Index: thread_mutex.c =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ /*Read/Write locking implementation based on the MultiLock code from * Stephen Beaulieu <gibbsjoseph@example.org> */ #include "beos/thread_mutex.h" #include "apr_strings.h" #include "apr_portable.h" static apr_status_t thread_mutex_cleanup(void *data) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } 1.1 apr/locks/netware/thread_mutex.c Index: thread_mutex.c =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_strings.h" #include "thread_mutex.h" #include "apr_portable.h" static apr_status_t thread_mutex_cleanup(void *data) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } 1.13 +2 -1 apr/locks/os2/Makefile.in Index: Makefile.in =================================================================== RCS file: /home/cvs/apr/locks/os2/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Makefile.in 2001/01/09 11:05:57 1.12 +++ Makefile.in 2001/09/04 23:28:51 1.13 @@ -1,5 +1,6 @@ -TARGETS = locks.lo +TARGETS = locks.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ 1.1 apr/locks/os2/thread_mutex.c Index: thread_mutex.c =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_portable.h" #include "thread_mutex.h" #include "fileio.h" #include <string.h> APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } 1.19 +2 -1 apr/locks/unix/Makefile.in Index: Makefile.in =================================================================== RCS file: /home/cvs/apr/locks/unix/Makefile.in,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Makefile.in 2001/01/09 11:05:59 1.18 +++ Makefile.in 2001/09/04 23:28:51 1.19 @@ -2,7 +2,8 @@ TARGETS = \ locks.lo \ crossproc.lo \ - intraproc.lo + intraproc.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ 1.1 apr/locks/unix/thread_mutex.c Index: thread_mutex.c =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact gibbsjoseph@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ #include "thread_mutex.h" #if APR_HAS_THREADS static apr_status_t thread_mutex_cleanup(void *data) { apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; apr_status_t stat; pthread_mutex_unlock(&mutex->mutex); stat = pthread_mutex_destroy(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; } #endif return stat; }
{'source': 'Apache Software Foundation Public Mail Archives'}