httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-apr/include apr_lock.h apr_thread_proc.h
Date Fri, 18 Jun 1999 19:11:21 GMT
rbb         99/06/18 12:11:20

  Modified:    apr/include apr_win.h
               apr/test client.dsp server.dsp test.dsw testfile.dsp
                        testproc.dsp testsock.dsp testthread.c timetest.dsp
               apr/threadproc/win32 thread.c
               include  apr_lock.h apr_thread_proc.h
  Added:       apr/locks/win32 locks.c locks.def locks.dsp locks.h
  Log:
  Initial locking code for windows, and fixes for windows based threads.
  
  Revision  Changes    Path
  1.4       +1 -0      apache-apr/apr/include/apr_win.h
  
  Index: apr_win.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/include/apr_win.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_win.h	1999/06/03 19:43:50	1.3
  +++ apr_win.h	1999/06/18 19:10:58	1.4
  @@ -76,6 +76,7 @@
   
   #define API_EXPORT(x)            x
   #define API_EXPORT_NONSTD(x)     x
  +#define API_THREAD_FUNC __stdcall
   
   #define strcasecmp(s1, s2)       stricmp(s1, s2)
   #define sleep(t)                 Sleep(t * 1000)
  
  
  
  1.1                  apache-apr/apr/locks/win32/locks.c
  
  Index: locks.c
  ===================================================================
  /* ====================================================================
   * Copyright (c) 1999 The Apache Group.  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. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``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 GROUP 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 Group.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  
  #include "apr_general.h"
  #include "apr_lib.h"
  #include "locks.h"
  
  ap_status_t ap_create_lock(ap_context_t *cont, ap_locktype_e type, char *fname, struct lock_t
**lock)
  {
      struct lock_t *newlock;
      SECURITY_ATTRIBUTES sec;
  
      newlock = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t));
  
      newlock->cntxt = cont;
      newlock->fname = strdup(fname);
  
      sec.nLength = sizeof(SECURITY_ATTRIBUTES);
      sec.lpSecurityDescriptor = NULL;
  
      if (type == APR_CROSS_PROCESS || type == APR_LOCKALL) {
          sec.bInheritHandle = TRUE;
      }
      else {
          sec.bInheritHandle = FALSE;
      }
  
      newlock->mutex = CreateMutex(&sec, FALSE, fname);
      *lock = newlock;
      return APR_SUCCESS;
  }
  
  ap_status_t ap_child_init_lock(ap_context_t *cont, char *fname, struct lock_t **lock)
  {
      (*lock) = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t));
  
      if ((*lock) == NULL) {
          return APR_ENOMEM;
      }
  
      (*lock)->fname = strdup(fname);
      (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname);
      
      if ((*lock)->mutex == NULL) {
          return APR_EEXIST;
      }
      return APR_SUCCESS;
  }
  
  ap_status_t ap_lock(struct lock_t *lock)
  {
      DWORD rv;
  
      rv = WaitForSingleObject(lock->mutex, INFINITE);
  
      if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
          return APR_SUCCESS;
      }
      if (rv == WAIT_TIMEOUT) {
          return APR_TIMEUP;
      }
  
      return APR_EEXIST;
  }
  
  ap_status_t ap_unlock(struct lock_t *lock)
  {
      if (ReleaseMutex(lock->mutex) == 0) {
          return APR_EEXIST;
      }
      return APR_SUCCESS;
  }
  
  ap_status_t ap_destroy_lock(struct lock_t *lock)
  {
      if (CloseHandle(lock->mutex) == 0) {
          return APR_EEXIST;
      }
      return APR_SUCCESS;
  }
  
  
  
  
  
  1.1                  apache-apr/apr/locks/win32/locks.def
  
  Index: locks.def
  ===================================================================
  ; locks.def : 
  
  LIBRARY locks
  DESCRIPTION ''
  
  EXPORTS
  	; Add new API calls to the end of this list.
  	ap_create_lock   @1
      ap_lock   @2
      ap_unlock   @3
      ap_destroy_lock   @4
      ap_child_init_lock   @5
  
  
  
  1.1                  apache-apr/apr/locks/win32/locks.dsp
  
  Index: locks.dsp
  ===================================================================
  # Microsoft Developer Studio Project File - Name="locks" - Package Owner=<4>
  # Microsoft Developer Studio Generated Build File, Format Version 5.00
  # ** DO NOT EDIT **
  
  # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
  
  CFG=locks - Win32 Debug
  !MESSAGE This is not a valid makefile. To build this project using NMAKE,
  !MESSAGE use the Export Makefile command and run
  !MESSAGE 
  !MESSAGE NMAKE /f "locks.mak".
  !MESSAGE 
  !MESSAGE You can specify a configuration when running NMAKE
  !MESSAGE by defining the macro CFG on the command line. For example:
  !MESSAGE 
  !MESSAGE NMAKE /f "locks.mak" CFG="locks - Win32 Debug"
  !MESSAGE 
  !MESSAGE Possible choices for configuration are:
  !MESSAGE 
  !MESSAGE "locks - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
  !MESSAGE "locks - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
  !MESSAGE 
  
  # Begin Project
  # PROP Scc_ProjName ""
  # PROP Scc_LocalPath ""
  CPP=cl.exe
  MTL=midl.exe
  RSC=rc.exe
  
  !IF  "$(CFG)" == "locks - Win32 Release"
  
  # PROP BASE Use_MFC 0
  # PROP BASE Use_Debug_Libraries 0
  # PROP BASE Output_Dir "Release"
  # PROP BASE Intermediate_Dir "Release"
  # PROP BASE Target_Dir ""
  # PROP Use_MFC 0
  # PROP Use_Debug_Libraries 0
  # PROP Output_Dir "Release"
  # PROP Intermediate_Dir "Release"
  # PROP Target_Dir ""
  # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
  # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
  # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
  # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
  # ADD BASE RSC /l 0x409 /d "NDEBUG"
  # ADD RSC /l 0x409 /d "NDEBUG"
  BSC32=bscmake.exe
  # ADD BASE BSC32 /nologo
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows
/dll /machine:I386
  # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
  
  !ELSEIF  "$(CFG)" == "locks - Win32 Debug"
  
  # PROP BASE Use_MFC 0
  # PROP BASE Use_Debug_Libraries 1
  # PROP BASE Output_Dir "Debug"
  # PROP BASE Intermediate_Dir "Debug"
  # PROP BASE Target_Dir ""
  # PROP Use_MFC 0
  # PROP Use_Debug_Libraries 1
  # PROP Output_Dir "Debug"
  # PROP Intermediate_Dir "Debug"
  # PROP Ignore_Export_Lib 0
  # PROP Target_Dir ""
  # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX
/FD /c
  # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\include" /I "..\..\..\include" /D "WIN32"
/D "_DEBUG" /D "_WINDOWS" /YX /FD /c
  # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
  # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
  # ADD BASE RSC /l 0x409 /d "_DEBUG"
  # ADD RSC /l 0x409 /d "_DEBUG"
  BSC32=bscmake.exe
  # ADD BASE BSC32 /nologo
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows
/dll /debug /machine:I386 /pdbtype:sept
  # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\lib\debug\lib.lib ..\..\misc\win32\debug\misc.lib
/nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
  
  !ENDIF 
  
  # Begin Target
  
  # Name "locks - Win32 Release"
  # Name "locks - Win32 Debug"
  # Begin Source File
  
  SOURCE=.\locks.c
  # End Source File
  # Begin Source File
  
  SOURCE=.\locks.def
  # End Source File
  # Begin Source File
  
  SOURCE=.\locks.h
  # End Source File
  # End Target
  # End Project
  
  
  
  1.1                  apache-apr/apr/locks/win32/locks.h
  
  Index: locks.h
  ===================================================================
  /* ====================================================================
   * Copyright (c) 1999 The Apache Group.  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. All advertising materials mentioning features or use of this
   *    software must display the following acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * 4. The names "Apache Server" and "Apache Group" must not be used to
   *    endorse or promote products derived from this software without
   *    prior written permission. For written permission, please contact
   *    apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * 6. Redistributions of any form whatsoever must retain the following
   *    acknowledgment:
   *    "This product includes software developed by the Apache Group
   *    for use in the Apache HTTP server project (http://www.apache.org/)."
   *
   * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``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 GROUP 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 Group.
   * For more information on the Apache Group and the Apache HTTP server
   * project, please see <http://www.apache.org/>.
   *
   */
  #ifndef LOCKS_H
  #define LOCKS_H
  
  #include "apr_lock.h"
  
  struct lock_t {
      ap_context_t *cntxt;
      HANDLE mutex;
      char *fname;
  };
  
  #endif  /* LOCKS_H */
  
  
  
  
  1.3       +2 -2      apache-apr/apr/test/client.dsp
  
  Index: client.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/client.dsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- client.dsp	1999/06/17 18:56:08	1.2
  +++ client.dsp	1999/06/18 19:11:00	1.3
  @@ -49,7 +49,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/machine:I386
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
   
   !ELSEIF  "$(CFG)" == "client - Win32 Debug"
   
  @@ -73,7 +73,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
..\locks\win32\debug\locks.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.3       +2 -2      apache-apr/apr/test/server.dsp
  
  Index: server.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/server.dsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- server.dsp	1999/06/17 18:56:09	1.2
  +++ server.dsp	1999/06/18 19:11:00	1.3
  @@ -49,7 +49,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/machine:I386
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
   
   !ELSEIF  "$(CFG)" == "server - Win32 Debug"
   
  @@ -73,7 +73,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
..\locks\win32\debug\locks.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.3       +12 -0     apache-apr/apr/test/test.dsw
  
  Index: test.dsw
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/test.dsw,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- test.dsw	1999/06/17 18:56:10	1.2
  +++ test.dsw	1999/06/18 19:11:00	1.3
  @@ -69,6 +69,18 @@
   
   ###############################################################################
   
  +Project: "testthread"=".\testthread.dsp" - Package Owner=<4>
  +
  +Package=<5>
  +{{{
  +}}}
  +
  +Package=<4>
  +{{{
  +}}}
  +
  +###############################################################################
  +
   Project: "timetest"=".\timetest.dsp" - Package Owner=<4>
   
   Package=<5>
  
  
  
  1.5       +2 -2      apache-apr/apr/test/testfile.dsp
  
  Index: testfile.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/testfile.dsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- testfile.dsp	1999/06/17 18:56:10	1.4
  +++ testfile.dsp	1999/06/18 19:11:01	1.5
  @@ -50,7 +50,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 ..\network_io\win32\Debug kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\Debug\lib.lib
..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib
..\time\win32\Debug\time.lib /nologo /subsystem:console /debug /machine:I386
  +# ADD LINK32 ..\network_io\win32\Debug ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
   
   !ELSEIF  "$(CFG)" == "testfile - Win32 Debug"
   
  @@ -74,7 +74,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
..\locks\win32\debug\locks.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.4       +2 -2      apache-apr/apr/test/testproc.dsp
  
  Index: testproc.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/testproc.dsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- testproc.dsp	1999/06/17 18:56:11	1.3
  +++ testproc.dsp	1999/06/18 19:11:01	1.4
  @@ -50,7 +50,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 ..\network_io\win32\Debug kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\Debug\lib.lib
..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib
..\time\win32\Debug\time.lib /nologo /subsystem:console /machine:I386
  +# ADD LINK32 ..\network_io\win32\Debug ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
   
   !ELSEIF  "$(CFG)" == "testproc - Win32 Debug"
   
  @@ -74,7 +74,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
..\locks\win32\debug\locks.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.3       +2 -2      apache-apr/apr/test/testsock.dsp
  
  Index: testsock.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/testsock.dsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- testsock.dsp	1999/06/17 18:56:11	1.2
  +++ testsock.dsp	1999/06/18 19:11:02	1.3
  @@ -50,7 +50,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 ..\network_io\win32\Debug kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\Debug\lib.lib
..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib
..\time\win32\Debug\time.lib /nologo /subsystem:console /machine:I386
  +# ADD LINK32 ..\network_io\win32\Debug ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
   
   !ELSEIF  "$(CFG)" == "testsock - Win32 Debug"
   
  @@ -74,7 +74,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 ..\network_io\win32\Debug\network_io.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\network_io\win32\Debug\network_io.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
..\locks\win32\debug\locks.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.7       +33 -19    apache-apr/apr/test/testthread.c
  
  Index: testthread.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/testthread.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- testthread.c	1999/05/25 17:03:54	1.6
  +++ testthread.c	1999/06/18 19:11:02	1.7
  @@ -62,11 +62,18 @@
   #include <unistd.h>
   #endif
   
  +
  +void * API_THREAD_FUNC thread_func1(void *data);
  +void * API_THREAD_FUNC thread_func2(void *data);
  +void * API_THREAD_FUNC thread_func3(void *data);
  +void * API_THREAD_FUNC thread_func4(void *data);
  +
  +
   ap_lock_t *thread_lock;
   ap_context_t *context;
   int x = 0;
   
  -void *thread_func1(void *data)
  +void * API_THREAD_FUNC thread_func1(void *data)
   {
       int i;
       for (i = 0; i < 10000; i++) {
  @@ -74,9 +81,10 @@
           x++;
           ap_unlock(thread_lock);
       }
  +    return NULL;
   } 
   
  -void *thread_func2(void *data)
  +void * API_THREAD_FUNC thread_func2(void *data)
   {
       int i;
       for (i = 0; i < 10000; i++) {
  @@ -84,9 +92,10 @@
           x++;
           ap_unlock(thread_lock);
       }
  +    return NULL;
   } 
   
  -void *thread_func3(void *data)
  +void * API_THREAD_FUNC thread_func3(void *data)
   {
       int i;
       for (i = 0; i < 10000; i++) {
  @@ -94,9 +103,10 @@
           x++;
           ap_unlock(thread_lock);
       }
  +    return NULL;
   } 
   
  -void *thread_func4(void *data)
  +void * API_THREAD_FUNC thread_func4(void *data)
   {
       int i;
       for (i = 0; i < 10000; i++) {
  @@ -104,6 +114,7 @@
           x++;
           ap_unlock(thread_lock);
       }
  +    return NULL;
   } 
   
   int main()
  @@ -112,8 +123,10 @@
       ap_thread_t *t2;
       ap_thread_t *t3;
       ap_thread_t *t4;
  -    ap_threadattr_t *tattr;
  -    ap_status_t st;
  +    ap_status_t s1;
  +    ap_status_t s2;
  +    ap_status_t s3;
  +    ap_status_t s4;
   
       fprintf(stdout, "Initializing the context......."); 
       if (ap_create_context(NULL, NULL, &context) != APR_SUCCESS) {
  @@ -123,38 +136,39 @@
       fprintf(stdout, "OK\n");
   
       fprintf(stdout, "Initializing the lock......."); 
  -    st = ap_create_lock(context, APR_INTRAPROCESS, "lock.file", &thread_lock); 
  -    if (st != APR_SUCCESS) {
  +    s1 = ap_create_lock(context, APR_INTRAPROCESS, "lock.file", &thread_lock); 
  +    if (s1 != APR_SUCCESS) {
           fprintf(stderr, "Could not create lock\n");
           exit(-1);
       }
       fprintf(stdout, "OK\n");
   
       fprintf(stdout, "Starting all the threads......."); 
  -    ap_create_thread(context, NULL, thread_func1, NULL, &t1);
  -    ap_create_thread(context, NULL, thread_func2, NULL, &t2);
  -    ap_create_thread(context, NULL, thread_func3, NULL, &t3);
  -    ap_create_thread(context, NULL, thread_func4, NULL, &t4);
  -    if (t1 == NULL || t2 == NULL || t3 == NULL || t4 == NULL) {
  +    s1 = ap_create_thread(context, NULL, thread_func1, NULL, &t1);
  +    s2 = ap_create_thread(context, NULL, thread_func2, NULL, &t2);
  +    s3 = ap_create_thread(context, NULL, thread_func3, NULL, &t3);
  +    s4 = ap_create_thread(context, NULL, thread_func4, NULL, &t4);
  +    if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
  +        s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
           fprintf(stderr, "Error starting thread\n");
           exit(-1);
       }
       fprintf(stdout, "OK\n");
   
       fprintf(stdout, "Waiting for threads to exit.......");
  -    ap_thread_join(t1, &st);
  -    ap_thread_join(t2, &st);
  -    ap_thread_join(t3, &st);
  -    ap_thread_join(t4, &st);
  +    ap_thread_join(t1, &s1);
  +    ap_thread_join(t2, &s2);
  +    ap_thread_join(t3, &s3);
  +    ap_thread_join(t4, &s4);
       fprintf (stdout, "OK\n");   
   
       fprintf(stdout, "Checking if locks worked......."); 
       if (x != 40000) {
  -        fprintf(stderr, "The locks didn't work????\n");
  +        fprintf(stderr, "The locks didn't work????  %d\n", x);
       }
       else {
           fprintf(stdout, "Everything is working!\n");
       }
   
  -    exit(1);
  +    return 1;
   }
  
  
  
  1.2       +2 -2      apache-apr/apr/test/timetest.dsp
  
  Index: timetest.dsp
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/timetest.dsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- timetest.dsp	1999/06/17 18:56:13	1.1
  +++ timetest.dsp	1999/06/18 19:11:03	1.2
  @@ -50,7 +50,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/machine:I386
  -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
/nologo /subsystem:console /machine:I386
  +# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib /nologo /subsystem:console /machine:I386
   
   !ELSEIF  "$(CFG)" == "timetest - Win32 Debug"
   
  @@ -74,7 +74,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib
..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib
/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib
..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib ..\locks\win32\debug\locks.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
/pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.2       +6 -2      apache-apr/apr/threadproc/win32/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/threadproc/win32/thread.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- thread.c	1999/06/08 15:38:11	1.1
  +++ thread.c	1999/06/18 19:11:15	1.2
  @@ -57,6 +57,7 @@
   #include "apr_thread_proc.h"
   #include "apr_general.h"
   #include "apr_lib.h"
  +#include "apr_win.h"
   #include <process.h>
   
   
  @@ -92,6 +93,7 @@
   {
       ap_status_t stat;
   	unsigned temp;
  +    int lasterror;
    
       (*new) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t));
   
  @@ -109,11 +111,13 @@
   	/* Use 0 for Thread Stack Size, because that will default the stack to the
   	 * same size as the calling thread. 
   	*/
  -    if (((*new)->td = (HANDLE *)_beginthreadex(func, 0, data, NULL, 0, &temp)) ==
0) {
  +    if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (API_THREAD_FUNC
*)(void *))func,
  +                                               data, 0, &temp)) == 0) {
  +        lasterror = GetLastError();
           return APR_EEXIST;
       }
   
  -	if (attr->detach) {
  +	if (attr && attr->detach) {
   		CloseHandle((*new)->td);
   	}
   
  
  
  
  1.4       +1 -0      apache-apr/include/apr_lock.h
  
  Index: apr_lock.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/include/apr_lock.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_lock.h	1999/05/24 18:16:49	1.3
  +++ apr_lock.h	1999/06/18 19:11:18	1.4
  @@ -72,6 +72,7 @@
   ap_status_t ap_lock(ap_lock_t *);
   ap_status_t ap_unlock(ap_lock_t *);
   ap_status_t ap_destroy_lock(ap_lock_t *);
  +ap_status_t ap_child_init_lock(ap_context_t *, char *, ap_lock_t **);
   
   #ifdef __cplusplus
   }
  
  
  
  1.15      +2 -1      apache-apr/include/apr_thread_proc.h
  
  Index: apr_thread_proc.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/include/apr_thread_proc.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- apr_thread_proc.h	1999/06/15 17:43:42	1.14
  +++ apr_thread_proc.h	1999/06/18 19:11:18	1.15
  @@ -59,6 +59,7 @@
   #include "apr_file_io.h"
   #include "apr_general.h"
   #include "apr_errno.h"
  +#include "apr_win.h"
   
   #ifdef __cplusplus
   extern "C" {
  @@ -79,7 +80,7 @@
   
   typedef struct threadkey_t        ap_key_t;
   
  -typedef void *(*ap_thread_start_t)(void *);
  +typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *);
   
   /* Thread Function definitions */
   ap_status_t ap_create_threadattr(ap_context_t *, ap_threadattr_t **);
  
  
  

Mime
View raw message