summaryrefslogtreecommitdiff
path: root/mysys/my_os2tls.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-12 03:28:02 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-12 03:28:02 +0300
commitbf30b263df84a07d7dfa9fd21a010826b22ab0d7 (patch)
tree34d4d5eb2aef4b99d0518f461da41a331af8574e /mysys/my_os2tls.c
parente6625f241009f3ae8fbdd0dd0e9332a1c85feaf5 (diff)
downloadmariadb-git-bf30b263df84a07d7dfa9fd21a010826b22ab0d7.tar.gz
Fixed problem with BIGINT and shutdown on AIX
Moved IF(test,column,NULL) code to 4.0 Changed mysys_priv.h to include my_pthread.h or my_no_pthread.h. Removed some CR's in os2 files. Docs/manual.texi: Changelog include/global.h: Fix for BIGINT problem on AIX include/my_no_pthread.h: Fixed typo libmysql/Makefile.shared: Fix for BIGINT problem on AIX mysql-test/mysql-test-run.sh: Fix to find xterm on AIX 4.3 mysql-test/r/bigint.result: Fix for BIGINT problem on AIX mysql-test/r/func_if.result: Change results for IF() after reverting change. mysql-test/t/bigint.test: Fix for BIGINT problem on AIX mysys/Makefile.am: Fix for BIGINT problem on AIX mysys/my_gethostbyname.c: Cleanup mysys/my_init.c: Cleanup mysys/my_net.c: Cleanup mysys/my_os2cond.c: Space & CRLF cleanup mysys/my_os2dirsrch.c: Space & CRLF cleanup mysys/my_os2dirsrch.h: Space & CRLF cleanup mysys/my_os2dlfcn.c: Space & CRLF cleanup mysys/my_os2file64.c: Space & CRLF cleanup mysys/my_os2mutex.c: Space & CRLF cleanup mysys/my_os2thread.c: Space & CRLF cleanup mysys/my_os2tls.c: Space & CRLF cleanup mysys/mysys_priv.h: cleanup mysys/thr_rwlock.c: cleanup sql/ha_innobase.cc: Removed usage of sprintf() Fixed missing end \0 which caused control characters to appear in SHOW INNODB STATUS sql/item_cmpfunc.cc: Reverted change for IF() sql/mysqld.cc: Fix for shutdown on AIX
Diffstat (limited to 'mysys/my_os2tls.c')
-rw-r--r--mysys/my_os2tls.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/mysys/my_os2tls.c b/mysys/my_os2tls.c
index 25d543d0768..1598fa34e2b 100644
--- a/mysys/my_os2tls.c
+++ b/mysys/my_os2tls.c
@@ -18,23 +18,23 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
-DWORD TlsAlloc( void);
-BOOL TlsFree( DWORD);
-PVOID TlsGetValue( DWORD);
-BOOL TlsSetValue( DWORD, PVOID);
+DWORD TlsAlloc( void);
+BOOL TlsFree( DWORD);
+PVOID TlsGetValue( DWORD);
+BOOL TlsSetValue( DWORD, PVOID);
-#define TLS_MINIMUM_AVAILABLE 64
+#define TLS_MINIMUM_AVAILABLE 64
-PULONG tls_storage; /* TLS local storage */
-DWORD tls_bits[2]; /* TLS in-use bits */
-pthread_mutex_t tls_mutex; /* TLS mutex for in-use bits */
+PULONG tls_storage; /* TLS local storage */
+DWORD tls_bits[2]; /* TLS in-use bits */
+pthread_mutex_t tls_mutex; /* TLS mutex for in-use bits */
-DWORD TlsAlloc( void)
+DWORD TlsAlloc( void)
{
DWORD index = -1;
DWORD mask, tibidx;
- int i;
+ int i;
if (tls_storage == NULL) {
@@ -43,12 +43,12 @@ DWORD TlsAlloc( void)
// allocate memory for TLS storage
rc = DosAllocThreadLocalMemory( 1, &tls_storage);
if (rc) {
- fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n", rc);
+ fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n", rc);
}
// create a mutex
if (pthread_mutex_init( &tls_mutex, NULL))
- fprintf( stderr, "Failed to init TLS mutex\n");
+ fprintf( stderr, "Failed to init TLS mutex\n");
}
pthread_mutex_lock( &tls_mutex);
@@ -56,18 +56,18 @@ DWORD TlsAlloc( void)
tibidx = 0;
if (tls_bits[0] == 0xFFFFFFFF) {
if (tls_bits[1] == 0xFFFFFFFF) {
- fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
- pthread_mutex_unlock( &tls_mutex);
- return -1;
+ fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
+ pthread_mutex_unlock( &tls_mutex);
+ return -1;
}
tibidx = 1;
}
for( i=0; i<32; i++) {
mask = (1 << i);
if ((tls_bits[ tibidx] & mask) == 0) {
- tls_bits[ tibidx] |= mask;
- index = (tibidx*32) + i;
- break;
+ tls_bits[ tibidx] |= mask;
+ index = (tibidx*32) + i;
+ break;
}
}
tls_storage[index] = 0;
@@ -79,9 +79,9 @@ DWORD TlsAlloc( void)
return index;
}
-BOOL TlsFree( DWORD index)
+BOOL TlsFree( DWORD index)
{
- int tlsidx;
+ int tlsidx;
DWORD mask;
if (index >= TLS_MINIMUM_AVAILABLE)
@@ -106,7 +106,7 @@ BOOL TlsFree( DWORD index)
}
-PVOID TlsGetValue( DWORD index)
+PVOID TlsGetValue( DWORD index)
{
if (index >= TLS_MINIMUM_AVAILABLE)
return NULL;
@@ -122,7 +122,7 @@ PVOID TlsGetValue( DWORD index)
return (PVOID) tls_array[ index];
}
-BOOL TlsSetValue( DWORD index, PVOID val)
+BOOL TlsSetValue( DWORD index, PVOID val)
{
// verify if memory has been allocated for this thread