mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
forgot a mutex
This commit is contained in:
parent
56121fdcd4
commit
e236a32c20
1 changed files with 5 additions and 1 deletions
|
@ -47,7 +47,7 @@ typedef struct _EnvThreadEntry {
|
|||
pthread_t owner;
|
||||
} EnvThreadEntry;
|
||||
|
||||
#define MAX_ENV_THREADS 10
|
||||
#define MAX_ENV_THREADS 5
|
||||
|
||||
struct _EnvThreadInfo {
|
||||
pthread_mutex_t mtxThreads;
|
||||
|
@ -111,6 +111,8 @@ map_remove( EnvThreadInfo* ti, JNIEnv* env )
|
|||
{
|
||||
pthread_t self = pthread_self();
|
||||
XP_Bool found = false;
|
||||
|
||||
pthread_mutex_lock( &ti->mtxThreads );
|
||||
for ( int ii = 0; !found && ii < VSIZE(ti->entries); ++ii ) {
|
||||
found = env == ti->entries[ii].env;
|
||||
if ( found ) {
|
||||
|
@ -121,6 +123,8 @@ map_remove( EnvThreadInfo* ti, JNIEnv* env )
|
|||
ti->entries[ii].owner = 0;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock( &ti->mtxThreads );
|
||||
|
||||
XP_ASSERT( found );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue