mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +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
d5ae8356b4
commit
039e50ecff
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 );
|
||||
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 ) {
|
||||
#ifdef LOG_MAPPING
|
||||
XP_LOGF( "%s: UNMAPPED env %p to thread %x (from %s; mapped by %s)", __func__,
|
||||
ti->entries[ii].env,
|
||||
(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
|
||||
entry->env, (int)entry->owner, func, entry->ownerFunc );
|
||||
XP_LOGF( "%s: %d entries left", __func__, countUsed( ti ) );
|
||||
entry->ownerFunc = NULL;
|
||||
#endif
|
||||
entry->env = NULL;
|
||||
entry->owner = 0;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock( &ti->mtxThreads );
|
||||
|
|
Loading…
Reference in a new issue