Merge pull request #181 from lovell/prevent-opcache-race-7.40

Allow op-cache winner in non-critical race condition
This commit is contained in:
John Cupitt 2014-09-19 11:29:34 +01:00
commit ec3366257f
1 changed files with 3 additions and 3 deletions

View File

@ -599,12 +599,12 @@ vips_cache_ref( VipsOperation *operation )
static void
vips_cache_insert( VipsOperation *operation )
{
VipsOperationCacheEntry *entry = g_new( VipsOperationCacheEntry, 1 );
/* It must not be in cache.
*/
g_assert( !g_hash_table_lookup( vips_cache_table, operation ) );
if( g_hash_table_lookup( vips_cache_table, operation ) )
return;
VipsOperationCacheEntry *entry = g_new( VipsOperationCacheEntry, 1 );
entry->operation = operation;
entry->time = 0;
entry->invalidate_id = 0;