Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita29d26a

Browse files
committed
Back out thread fix until I get clarification.
1 parenta41463e commita29d26a

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.276 2004/07/12 14:11:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.277 2004/07/12 14:16:28 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3193,16 +3193,10 @@ default_threadlock(int acquire)
31933193
#ifndefWIN32
31943194
staticpthread_mutex_tsinglethread_lock=PTHREAD_MUTEX_INITIALIZER;
31953195
#else
3196-
staticpthread_mutex_tsinglethread_lock=NULL;
3197-
staticlongmutex_initlock=0;
3198-
3199-
if (singlethread_lock==NULL) {
3200-
while(InterlockedExchange(&mutex_initlock,1)==1)
3201-
/* loop, another thread own the lock */ ;
3202-
if (singlethread_lock==NULL)
3203-
pthread_mutex_init(&singlethread_lock,NULL);
3204-
InterlockedExchange(&mutex_initlock,0);
3205-
}
3196+
staticpthread_mutex_tsinglethread_lock;
3197+
staticlongmutex_initialized=0;
3198+
if (!InterlockedExchange(&mutex_initialized,1L))
3199+
pthread_mutex_init(&singlethread_lock,NULL);
32063200
#endif
32073201
if (acquire)
32083202
pthread_mutex_lock(&singlethread_lock);

‎src/interfaces/libpq/fe-secure.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.43 2004/07/12 14:11:17 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.44 2004/07/12 14:16:28 momjian Exp $
1515
*
1616
* NOTES
1717
* The client *requires* a valid server certificate. Since
@@ -867,16 +867,10 @@ init_ssl_system(PGconn *conn)
867867
#ifndefWIN32
868868
staticpthread_mutex_tinit_mutex=PTHREAD_MUTEX_INITIALIZER;
869869
#else
870-
staticpthread_mutex_tinit_mutex=NULL;
871-
staticlongmutex_initlock=0;
872-
873-
if (init_mutex==NULL) {
874-
while(InterlockedExchange(&mutex_initlock,1)==1)
875-
/* loop, another thread own the lock */ ;
876-
if (init_mutex==NULL)
877-
pthread_mutex_init(&init_mutex,NULL);
878-
InterlockedExchange(&mutex_initlock,0);
879-
}
870+
staticpthread_mutex_tinit_mutex;
871+
staticlongmutex_initialized=0L;
872+
if (!InterlockedExchange(&mutex_initialized,1L))
873+
pthread_mutex_init(&init_mutex,NULL);
880874
#endif
881875
pthread_mutex_lock(&init_mutex);
882876

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp