mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
remove misplaced assert
It's an error to use an env with the wrong thread, but it IS possible for more than one thread to be associated with the same env. So don't assert to the contrary.
This commit is contained in:
parent
eeddd8d7cb
commit
91b7cf8bd9
1 changed files with 6 additions and 9 deletions
|
@ -202,20 +202,17 @@ map_remove_prv( EnvThreadInfo* ti, JNIEnv* env, const char* func )
|
||||||
|
|
||||||
pthread_mutex_lock( &ti->mtxThreads );
|
pthread_mutex_lock( &ti->mtxThreads );
|
||||||
for ( int ii = 0; !found && ii < ti->nEntries; ++ii ) {
|
for ( int ii = 0; !found && ii < ti->nEntries; ++ii ) {
|
||||||
found = env == ti->entries[ii].env;
|
EnvThreadEntry* entry = &ti->entries[ii];
|
||||||
|
found = env == entry->env;
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
#ifdef LOG_MAPPING
|
#ifdef LOG_MAPPING
|
||||||
XP_LOGF( "%s: UNMAPPED env %p to thread %x (from %s; mapped by %s)", __func__,
|
XP_LOGF( "%s: UNMAPPED env %p to thread %x (from %s; mapped by %s)", __func__,
|
||||||
ti->entries[ii].env,
|
entry->env, (int)entry->owner, func, entry->ownerFunc );
|
||||||
(int)ti->entries[ii].owner, func,
|
|
||||||
ti->entries[ii].ownerFunc );
|
|
||||||
#endif
|
|
||||||
XP_ASSERT( pthread_self() == ti->entries[ii].owner );
|
|
||||||
ti->entries[ii].env = NULL;
|
|
||||||
ti->entries[ii].owner = 0;
|
|
||||||
#ifdef LOG_MAPPING
|
|
||||||
XP_LOGF( "%s: %d entries left", __func__, countUsed( ti ) );
|
XP_LOGF( "%s: %d entries left", __func__, countUsed( ti ) );
|
||||||
|
entry->ownerFunc = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
entry->env = NULL;
|
||||||
|
entry->owner = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock( &ti->mtxThreads );
|
pthread_mutex_unlock( &ti->mtxThreads );
|
||||||
|
|
Loading…
Add table
Reference in a new issue