Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

This commit was manufactured by cvs2svn to create tag

'BEFORE_REMOVING_GC_STEP1'.
  • Loading branch information...
commit a93337e39b222fc49e41bbf4600e1b8460187333 1 parent cdce334
authored July 09, 1999
4  TSRM/Makefile.am
... ...
@@ -1,4 +0,0 @@
1  
-## process this file with automake to produce Makefile.am
2  
-AUTOMAKE_OPTIONS=foreign
3  
-lib_LIBRARIES=libtsrm.a
4  
-libtsrm_a_SOURCES = TSRM.c
392  TSRM/TSRM.c
... ...
@@ -1,392 +0,0 @@
1  
-/*
2  
-   +----------------------------------------------------------------------+
3  
-   | Thread Safe Resource Manager                                         |
4  
-   +----------------------------------------------------------------------+
5  
-   | Copyright (c) 1998, 1999 Zeev Suraski                                |
6  
-   +----------------------------------------------------------------------+
7  
-   | This source file is subject to the Zend license, that is bundled     |
8  
-   | with this package in the file LICENSE.  If you did not receive a     |
9  
-   | copy of the Zend license, please mail us at zend@zend.com so we can  |
10  
-   | send you a copy immediately.                                         |
11  
-   +----------------------------------------------------------------------+
12  
-   | Author:  Zeev Suraski <zeev@zend.com>                                |
13  
-   +----------------------------------------------------------------------+
14  
-*/
15  
-
16  
-
17  
-#include "TSRM.h"
18  
-#include <stdio.h>
19  
-#include <stdlib.h>
20  
-
21  
-#if HAVE_STDARG_H
22  
-#include <stdarg.h>
23  
-#endif
24  
-
25  
-typedef struct _tsrm_tls_entry tsrm_tls_entry;
26  
-
27  
-struct _tsrm_tls_entry {
28  
-	void **storage;
29  
-	int count;
30  
-	THREAD_T thread_id;
31  
-	tsrm_tls_entry *next;
32  
-};
33  
-
34  
-
35  
-typedef struct {
36  
-	size_t size;
37  
-	void (*ctor)(void *resource);
38  
-	void (*dtor)(void *resource);
39  
-} tsrm_resource_type;
40  
-
41  
-
42  
-/* The memory manager table */
43  
-static tsrm_tls_entry	**tsrm_tls_table;
44  
-static int				tsrm_tls_table_size;
45  
-static ts_rsrc_id		id_count;
46  
-
47  
-/* The resource sizes table */
48  
-static tsrm_resource_type	*resource_types_table;
49  
-static int					resource_types_table_size;
50  
-
51  
-
52  
-static MUTEX_T tsmm_mutex;	/* thread-safe memory manager mutex */
53  
-
54  
-/* Debug support */
55  
-static int tsrm_debug(const char *format, ...);
56  
-static int tsrm_debug_status;
57  
-
58  
-
59  
-/* Startup TSRM (call once for the entire process) */
60  
-TSRM_FUNC int tsrm_startup(int expected_threads, int expected_resources, int debug_status)
61  
-{
62  
-	tsrm_tls_table_size = expected_threads;
63  
-	tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *));
64  
-	if (!tsrm_tls_table) {
65  
-		return 0;
66  
-	}
67  
-	id_count=0;
68  
-
69  
-	resource_types_table_size = expected_resources;
70  
-	resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type));
71  
-	if (!resource_types_table) {
72  
-		free(tsrm_tls_table);
73  
-		return 0;
74  
-	}
75  
-
76  
-	tsmm_mutex = tsrm_mutex_alloc();
77  
-
78  
-	tsrm_debug_status = debug_status;
79  
-
80  
-	tsrm_debug("Started up TSRM, %d expected threads, %d expected resources\n", expected_threads, expected_resources);
81  
-	return 1;
82  
-}
83  
-
84  
-
85  
-/* Shutdown TSRM (call once for the entire process) */
86  
-TSRM_FUNC void tsrm_shutdown()
87  
-{
88  
-	int i;
89  
-
90  
-	if (tsrm_tls_table) {
91  
-		for (i=0; i<tsrm_tls_table_size; i++) {
92  
-			tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
93  
-
94  
-			while (p) {
95  
-				int j;
96  
-
97  
-				next_p = p->next;
98  
-				for (j=0; j<id_count; j++) {
99  
-					free(p->storage[j]);
100  
-				}
101  
-				free(p->storage);
102  
-				free(p);
103  
-				p = next_p;
104  
-			}
105  
-		}
106  
-		free(tsrm_tls_table);
107  
-	}
108  
-	if (resource_types_table) {
109  
-		free(resource_types_table);
110  
-	}
111  
-	tsrm_mutex_free(tsmm_mutex);
112  
-	tsrm_debug("Shutdown TSRM\n");
113  
-}
114  
-
115  
-
116  
-/* allocates a new thread-safe-resource id */
117  
-TSRM_FUNC ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), void (*dtor)(void *resource))
118  
-{
119  
-	ts_rsrc_id new_id;
120  
-	int i;
121  
-
122  
-	tsrm_debug("Obtaining a new resource id, %d bytes\n", size);
123  
-
124  
-	tsrm_mutex_lock(tsmm_mutex);
125  
-
126  
-	/* obtain a resource id */
127  
-	new_id = id_count++;
128  
-	tsrm_debug("Obtained resource id %d\n", new_id);
129  
-
130  
-	/* store the new resource type in the resource sizes table */
131  
-	if (resource_types_table_size < id_count) {
132  
-		resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
133  
-		if (!resource_types_table) {
134  
-			return -1;
135  
-		}
136  
-		resource_types_table_size = id_count;
137  
-	}
138  
-	resource_types_table[new_id].size = size;
139  
-	resource_types_table[new_id].ctor = ctor;
140  
-	resource_types_table[new_id].dtor = dtor;
141  
-
142  
-	/* enlarge the arrays for the already active threads */
143  
-	for (i=0; i<tsrm_tls_table_size; i++) {
144  
-		tsrm_tls_entry *p = tsrm_tls_table[i];
145  
-
146  
-		while (p) {
147  
-			if (p->count < id_count) {
148  
-				int j;
149  
-
150  
-				p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
151  
-				for (j=p->count; j<id_count; j++) {
152  
-					p->storage[j] = (void *) malloc(resource_types_table[j].size);
153  
-					if (resource_types_table[j].ctor) {
154  
-						resource_types_table[j].ctor(p->storage[j]);
155  
-					}
156  
-				}
157  
-				p->count = id_count;
158  
-			}
159  
-			p = p->next;
160  
-		}
161  
-	}
162  
-	tsrm_mutex_unlock(tsmm_mutex);
163  
-
164  
-	tsrm_debug("Successfully allocated new resource id %d\n", new_id);
165  
-	return new_id;
166  
-}
167  
-
168  
-
169  
-static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id)
170  
-{
171  
-	int i;
172  
-
173  
-	(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
174  
-	(*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
175  
-	(*thread_resources_ptr)->count = id_count;
176  
-	(*thread_resources_ptr)->thread_id = thread_id;
177  
-	(*thread_resources_ptr)->next = NULL;
178  
-	for (i=0; i<id_count; i++) {
179  
-		(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
180  
-		if (resource_types_table[i].ctor) {
181  
-			resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
182  
-		}
183  
-	}
184  
-}
185  
-
186  
-
187  
-/* fetches the requested resource for the current thread */
188  
-void *ts_resource(ts_rsrc_id id)
189  
-{
190  
-	THREAD_T thread_id = tsrm_thread_id();
191  
-	int hash_value;
192  
-	tsrm_tls_entry *thread_resources;
193  
-	void *resource;
194  
-
195  
-	tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
196  
-	tsrm_mutex_lock(tsmm_mutex);
197  
-
198  
-	hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
199  
-	thread_resources = tsrm_tls_table[hash_value];
200  
-
201  
-	if (!thread_resources) {
202  
-		allocate_new_resource(&tsrm_tls_table[hash_value], thread_id);
203  
-		thread_resources = tsrm_tls_table[hash_value];
204  
-	} else {
205  
-		 do {
206  
-			if (thread_resources->thread_id == thread_id) {
207  
-				break;
208  
-			}
209  
-			if (thread_resources->next) {
210  
-				thread_resources = thread_resources->next;
211  
-			} else {
212  
-				allocate_new_resource(&thread_resources->next, thread_id);
213  
-				thread_resources = thread_resources->next;
214  
-				break;
215  
-			}
216  
-		 } while (thread_resources);
217  
-	}
218  
-
219  
-	resource = thread_resources->storage[id];
220  
-
221  
-	tsrm_mutex_unlock(tsmm_mutex);
222  
-
223  
-	tsrm_debug("Successfully fetched resource id %d for thread id %ld - %x\n", id, (long) thread_id, (long) resource);
224  
-	return resource;
225  
-}
226  
-
227  
-
228  
-/* frees all resources allocated for the current thread */
229  
-void ts_free_thread()
230  
-{
231  
-	THREAD_T thread_id = tsrm_thread_id();
232  
-	int hash_value;
233  
-	tsrm_tls_entry *thread_resources;
234  
-	tsrm_tls_entry *last=NULL;
235  
-
236  
-	tsrm_mutex_lock(tsmm_mutex);
237  
-	hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
238  
-	thread_resources = tsrm_tls_table[hash_value];
239  
-
240  
-	while (thread_resources) {
241  
-		if (thread_resources->thread_id == thread_id) {
242  
-			int i;
243  
-
244  
-			for (i=0; i<thread_resources->count; i++) {
245  
-				if (resource_types_table[i].dtor) {
246  
-					resource_types_table[i].dtor(thread_resources->storage[i]);
247  
-				}
248  
-				free(thread_resources->storage[i]);
249  
-			}
250  
-			free(thread_resources->storage);
251  
-			if (last) {
252  
-				last->next = thread_resources->next;
253  
-			} else {
254  
-				tsrm_tls_table[hash_value]=NULL;
255  
-			}
256  
-			free(thread_resources);
257  
-			break;
258  
-		}
259  
-		if (thread_resources->next) {
260  
-			last = thread_resources;
261  
-		}
262  
-		thread_resources = thread_resources->next;
263  
-	}
264  
-	tsrm_mutex_unlock(tsmm_mutex);
265  
-}
266  
-
267  
-
268  
-/* deallocates all occurrences of a given id */
269  
-void ts_free_id(ts_rsrc_id id)
270  
-{
271  
-}
272  
-
273  
-
274  
-
275  
-
276  
-/*
277  
- * Utility Functions
278  
- */
279  
-
280  
-/* Obtain the current thread id */
281  
-TSRM_FUNC THREAD_T tsrm_thread_id(void)
282  
-{
283  
-#ifdef WIN32
284  
-	return GetCurrentThreadId();
285  
-#elif defined(PTHREADS)
286  
-	return pthread_self();
287  
-#elif defined(NSAPI)
288  
-	return systhread_current();
289  
-#elif defined(PI3WEB)
290  
-	return PIThread_getCurrent();
291  
-#endif
292  
-}
293  
-
294  
-
295  
-/* Allocate a mutex */
296  
-TSRM_FUNC MUTEX_T tsrm_mutex_alloc( void )
297  
-{
298  
-    MUTEX_T mutexp;
299  
-
300  
-#ifdef WIN32
301  
-    mutexp = CreateMutex(NULL,FALSE,NULL);
302  
-#elif defined(PTHREADS)
303  
-	mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
304  
-	pthread_mutex_init(mutexp,NULL);
305  
-#elif defined(NSAPI)
306  
-	mutexp = crit_init();
307  
-#elif defined(PI3WEB)
308  
-	mutexp = PIPlatform_allocLocalMutex();
309  
-#endif
310  
-#ifdef THR_DEBUG
311  
-		printf("Mutex created thread: %d\n",mythreadid());
312  
-#endif
313  
-    return( mutexp );
314  
-}
315  
-
316  
-
317  
-/* Free a mutex */
318  
-TSRM_FUNC void tsrm_mutex_free( MUTEX_T mutexp )
319  
-{
320  
-    if (mutexp) {
321  
-#ifdef WIN32
322  
-		CloseHandle(mutexp);
323  
-#elif defined(PTHREADS)
324  
-		free(mutexp);
325  
-#elif defined(NSAPI)
326  
-		crit_terminate(mutexp);
327  
-#elif defined(PI3WEB)
328  
-		PISync_delete(mutexp) 
329  
-#endif
330  
-    }
331  
-#ifdef THR_DEBUG
332  
-		printf("Mutex freed thread: %d\n",mythreadid());
333  
-#endif
334  
-}
335  
-
336  
-
337  
-/* Lock a mutex */
338  
-TSRM_FUNC int tsrm_mutex_lock( MUTEX_T mutexp )
339  
-{
340  
-	//tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
341  
-#ifdef WIN32
342  
-    return WaitForSingleObject(mutexp,1000);
343  
-#elif defined(PTHREADS)
344  
-	return pthread_mutex_lock(mutexp);
345  
-#elif defined(NSAPI)
346  
-	return crit_enter(mutexp);
347  
-#elif defined(PI3WEB)
348  
-	return PISync_lock(mutexp);
349  
-#endif
350  
-}
351  
-
352  
-
353  
-/* Unlock a mutex */
354  
-TSRM_FUNC int tsrm_mutex_unlock( MUTEX_T mutexp )
355  
-{
356  
-	//tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
357  
-#ifdef WIN32
358  
-    return ReleaseMutex(mutexp);
359  
-#elif defined(PTHREADS)
360  
-	return pthread_mutex_unlock(mutexp);
361  
-#elif defined(NSAPI)
362  
-	return crit_exit(mutexp);
363  
-#elif defined(PI3WEB)
364  
-	return PISync_unlock(mutexp);
365  
-#endif
366  
-}
367  
-
368  
-
369  
-/*
370  
- * Debug support
371  
- */
372  
-
373  
-static int tsrm_debug(const char *format, ...)
374  
-{
375  
-	if (tsrm_debug_status) {
376  
-		va_list args;
377  
-		int size;
378  
-
379  
-		va_start(args, format);
380  
-		size = vprintf(format, args);
381  
-		va_end(args);
382  
-		return size;
383  
-	} else {
384  
-		return 0;
385  
-	}
386  
-}
387  
-
388  
-
389  
-void tsrm_debug_set(int status)
390  
-{
391  
-	tsrm_debug_status = status;
392  
-}
100  TSRM/TSRM.dsp
... ...
@@ -1,100 +0,0 @@
1  
-# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4>
2  
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
3  
-# ** DO NOT EDIT **
4  
-
5  
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
6  
-
7  
-CFG=TSRM - Win32 Debug_TS
8  
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9  
-!MESSAGE use the Export Makefile command and run
10  
-!MESSAGE 
11  
-!MESSAGE NMAKE /f "TSRM.mak".
12  
-!MESSAGE 
13  
-!MESSAGE You can specify a configuration when running NMAKE
14  
-!MESSAGE by defining the macro CFG on the command line. For example:
15  
-!MESSAGE 
16  
-!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS"
17  
-!MESSAGE 
18  
-!MESSAGE Possible choices for configuration are:
19  
-!MESSAGE 
20  
-!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
21  
-!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library")
22  
-!MESSAGE 
23  
-
24  
-# Begin Project
25  
-# PROP AllowPerConfigDependencies 0
26  
-# PROP Scc_ProjName ""
27  
-# PROP Scc_LocalPath ""
28  
-CPP=cl.exe
29  
-RSC=rc.exe
30  
-
31  
-!IF  "$(CFG)" == "TSRM - Win32 Debug_TS"
32  
-
33  
-# PROP BASE Use_MFC 0
34  
-# PROP BASE Use_Debug_Libraries 1
35  
-# PROP BASE Output_Dir "TSRM___Win32_Debug_TS"
36  
-# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS"
37  
-# PROP BASE Target_Dir ""
38  
-# PROP Use_MFC 0
39  
-# PROP Use_Debug_Libraries 1
40  
-# PROP Output_Dir "Debug_TS"
41  
-# PROP Intermediate_Dir "Debug_TS"
42  
-# PROP Target_Dir ""
43  
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
44  
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
45  
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
46  
-# ADD RSC /l 0x40d /d "_DEBUG"
47  
-BSC32=bscmake.exe
48  
-# ADD BASE BSC32 /nologo
49  
-# ADD BSC32 /nologo
50  
-LIB32=link.exe -lib
51  
-# ADD BASE LIB32 /nologo
52  
-# ADD LIB32 /nologo
53  
-
54  
-!ELSEIF  "$(CFG)" == "TSRM - Win32 Release_TS"
55  
-
56  
-# PROP BASE Use_MFC 0
57  
-# PROP BASE Use_Debug_Libraries 0
58  
-# PROP BASE Output_Dir "TSRM___Win32_Release_TS"
59  
-# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS"
60  
-# PROP BASE Target_Dir ""
61  
-# PROP Use_MFC 0
62  
-# PROP Use_Debug_Libraries 0
63  
-# PROP Output_Dir "Release_TS"
64  
-# PROP Intermediate_Dir "Release_TS"
65  
-# PROP Target_Dir ""
66  
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
67  
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
68  
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
69  
-# ADD RSC /l 0x40d /d "NDEBUG"
70  
-BSC32=bscmake.exe
71  
-# ADD BASE BSC32 /nologo
72  
-# ADD BSC32 /nologo
73  
-LIB32=link.exe -lib
74  
-# ADD BASE LIB32 /nologo
75  
-# ADD LIB32 /nologo
76  
-
77  
-!ENDIF 
78  
-
79  
-# Begin Target
80  
-
81  
-# Name "TSRM - Win32 Debug_TS"
82  
-# Name "TSRM - Win32 Release_TS"
83  
-# Begin Group "Source Files"
84  
-
85  
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86  
-# Begin Source File
87  
-
88  
-SOURCE=.\TSRM.c
89  
-# End Source File
90  
-# End Group
91  
-# Begin Group "Header Files"
92  
-
93  
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
94  
-# Begin Source File
95  
-
96  
-SOURCE=.\TSRM.h
97  
-# End Source File
98  
-# End Group
99  
-# End Target
100  
-# End Project
97  TSRM/TSRM.h
... ...
@@ -1,97 +0,0 @@
1  
-/*
2  
-   +----------------------------------------------------------------------+
3  
-   | Thread Safe Resource Manager                                         |
4  
-   +----------------------------------------------------------------------+
5  
-   | Copyright (c) 1998, 1999 Zeev Suraski                                |
6  
-   +----------------------------------------------------------------------+
7  
-   | This source file is subject to the Zend license, that is bundled     |
8  
-   | with this package in the file LICENSE.  If you did not receive a     |
9  
-   | copy of the Zend license, please mail us at zend@zend.com so we can  |
10  
-   | send you a copy immediately.                                         |
11  
-   +----------------------------------------------------------------------+
12  
-   | Author:  Zeev Suraski <zeev@zend.com>                                |
13  
-   +----------------------------------------------------------------------+
14  
-*/
15  
-
16  
-
17  
-#ifndef _TSRM_H
18  
-#define _TSRM_H
19  
-
20  
-#ifdef HAVE_CONFIG_H
21  
-# include "tsrm_config.h"
22  
-#endif
23  
-
24  
-#if WIN32||WINNT
25  
-# include <windows.h>
26  
-#elif defined(PTHREADS)
27  
-# include <pthread.h>
28  
-#endif
29  
-
30  
-typedef int ts_rsrc_id;
31  
-
32  
-#if WIN32||WINNT
33  
-#	ifdef TSRM_EXPORTS
34  
-#	define TSRM_API __declspec(dllexport)
35  
-#	else
36  
-#	define TSRM_API __declspec(dllimport)
37  
-#	endif
38  
-#else
39  
-#	define TSRM_API
40  
-#endif
41  
-
42  
-
43  
-/* Define TSRM_FUNC */
44  
-#ifdef __cplusplus
45  
-#define TSRM_FUNC	extern "C" TSRM_API
46  
-#else
47  
-#define TSRM_FUNC	TSRM_API
48  
-#endif
49  
-
50  
-
51  
-/* Define THREAD_T and MUTEX_T */
52  
-#if defined(WIN32)
53  
-# define THREAD_T DWORD
54  
-# define MUTEX_T void *
55  
-#elif defined(PTHREADS)
56  
-# define THREAD_T pthread_t
57  
-# define MUTEX_T pthread_mutex_t *
58  
-#elif defined(NSAPI)
59  
-# define THREAD_T SYS_THREAD
60  
-# define MUTEX_T CRITICAL
61  
-#elif defined(PI3WEB)
62  
-# define THREAD_T PIThread *
63  
-# define MUTEX_T PISync *
64  
-#endif
65  
-
66  
-
67  
-#define THREAD_HASH_OF(thr,ts)  thr%ts
68  
-
69  
-
70  
-/* startup/shutdown */
71  
-TSRM_FUNC int tsrm_startup(int expected_threads, int expected_resources, int debug_status);
72  
-TSRM_FUNC void tsrm_shutdown();
73  
-
74  
-/* allocates a new thread-safe-resource id */
75  
-TSRM_FUNC ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), void (*dtor)(void *resource));
76  
-
77  
-/* fetches the requested resource for the current thread */
78  
-TSRM_FUNC void *ts_resource(ts_rsrc_id id);
79  
-
80  
-/* frees all resources allocated for the current thread */
81  
-TSRM_FUNC void ts_free_thread();
82  
-
83  
-/* deallocates all occurrences of a given id */
84  
-TSRM_FUNC void ts_free_id(ts_rsrc_id id);
85  
-
86  
-
87  
-/* Debug support */
88  
-TSRM_FUNC void tsrm_debug_set(int status);
89  
-
90  
-/* utility functions */
91  
-TSRM_FUNC THREAD_T tsrm_thread_id(void);
92  
-TSRM_FUNC MUTEX_T tsrm_mutex_alloc(void);
93  
-TSRM_FUNC void tsrm_mutex_free(MUTEX_T mutexp);
94  
-TSRM_FUNC int tsrm_mutex_lock(MUTEX_T mutexp);
95  
-TSRM_FUNC int tsrm_mutex_unlock(MUTEX_T mutexp);
96  
-
97  
-#endif /* _TSRM_H */
7  TSRM/acconfig.h
... ...
@@ -1,7 +0,0 @@
1  
-#undef PTHREADS
2  
-
3  
-#ifdef DEFINE_TSRM_VERSION
4  
-# undef PACKAGE
5  
-# undef VERSION
6  
-#endif
7  
-
24  TSRM/buildconf
... ...
@@ -1,24 +0,0 @@
1  
-#!/bin/sh
2  
-
3  
-mv aclocal.m4 aclocal.m4.old 2>/dev/null
4  
-aclocal
5  
-if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
6  
-    echo keeping ${1}aclocal.m4
7  
-    mv aclocal.m4.old aclocal.m4
8  
-else
9  
-    echo created or modified ${1}aclocal.m4
10  
-fi
11  
-
12  
-autoheader
13  
-
14  
-automake --add-missing --include-deps
15  
-
16  
-mv configure configure.old 2>/dev/null
17  
-autoconf
18  
-if cmp configure.old configure > /dev/null 2>&1; then
19  
-    echo keeping ${1}configure
20  
-    mv configure.old configure
21  
-else
22  
-    echo created or modified ${1}configure
23  
-fi
24  
-
24  TSRM/configure.in
... ...
@@ -1,24 +0,0 @@
1  
-dnl $Id$
2  
-dnl
3  
-dnl Minimalistic configure.in for TSRM.
4  
-dnl
5  
-
6  
-AC_INIT(TSRM.c)
7  
-AM_INIT_AUTOMAKE(TSRM, 1.0)
8  
-AM_CONFIG_HEADER(tsrm_config.h)
9  
-
10  
-AC_PROG_CC
11  
-AC_PROG_CC_C_O
12  
-AC_PROG_RANLIB
13  
-
14  
-AC_CHECK_LIB(pthread, pthread_create, [
15  
-  AC_DEFINE(PTHREADS)
16  
-  LIBS="$LIBS -lpthread"
17  
-],[
18  
-  AC_MSG_ERROR(You need pthreads to build TSRM.)
19  
-])
20  
-
21  
-AC_CHECK_HEADERS(stdarg.h)
22  
-
23  
-AC_OUTPUT(Makefile)
24  
-
26  ext/pcre/config0.m4
... ...
@@ -1,26 +0,0 @@
1  
-dnl $Id$
2  
-dnl config.m4 for extension pcre
3  
-
4  
-dnl By default we'll compile and link against the bundled PCRE library
5  
-dnl if DIR is supplied, we'll use that for linking
6  
-
7  
-AC_MSG_CHECKING(whether to include PCRE support)
8  
-AC_ARG_WITH(pcre-regex,
9  
-[  --with-pcre-regex       Include Perl Compatible Regular Expressions support],[
10  
-  if test "$withval" = "yes"; then
11  
-    EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
12  
-    PCRE_SUBDIR="pcrelib"
13  
-    AC_DEFINE(HAVE_PCRE, 1)
14  
-    AC_MSG_RESULT(yes)
15  
-    PHP_EXTENSION(pcre)
16  
-  else
17  
-    AC_MSG_RESULT(no)
18  
-  fi
19  
-],[
20  
-  EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
21  
-  PCRE_SUBDIR="pcrelib"
22  
-  AC_DEFINE(HAVE_PCRE, 1)
23  
-  AC_MSG_RESULT(yes)
24  
-  PHP_EXTENSION(pcre)
25  
-]) 
26  
-AC_SUBST(PCRE_SUBDIR)

0 notes on commit a93337e

Please sign in to comment.
Something went wrong with that request. Please try again.