Changeset: 4b4c5a795159 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4b4c5a795159
Modified Files:
gdk/gdk_system.c
Branch: default
Log Message:
Always add locked lock to some thread (i.e. main thread before there are more).
Only when LOCK_OWNER is defined.
diffs (39 lines):
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -364,9 +364,11 @@ MT_thread_setcondwait(MT_Cond *cond)
void
MT_thread_add_mylock(MT_Lock *lock)
{
+ struct winthread *w;
if (threadslot == TLS_OUT_OF_INDEXES)
- return;
- struct winthread *w = TlsGetValue(threadslot);
+ w = &mainthread;
+ else
+ w = TlsGetValue(threadslot);
if (w) {
lock->nxt = w->mylocks;
@@ -837,9 +839,11 @@ MT_thread_setcondwait(MT_Cond *cond)
void
MT_thread_add_mylock(MT_Lock *lock)
{
+ struct posthread *p;
if (!thread_initialized)
- return;
- struct posthread *p = pthread_getspecific(threadkey);
+ p = &mainthread;
+ else
+ p = pthread_getspecific(threadkey);
if (p) {
lock->nxt = p->mylocks;
@@ -1028,6 +1032,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
int ret;
struct posthread *p;
+ assert(thread_initialized);
join_threads();
if (threadname == NULL) {
TRC_CRITICAL(GDK, "Thread must have a name\n");
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]