[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29622] trunk/blender/source/blender/ blenlib/intern/threads.c: BLI_init_threads/ BLI_end_threads with NULL listbase now raises thread level
Brecht Van Lommel
brecht at blender.org
Tue Jun 22 17:17:12 CEST 2010
Revision: 29622
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29622
Author: blendix
Date: 2010-06-22 17:17:12 +0200 (Tue, 22 Jun 2010)
Log Message:
-----------
BLI_init_threads/BLI_end_threads with NULL listbase now raises thread level
and enables mutex protection on MEM_* functions, useful when you want to call
these functions from an OpenMP thread.
(merge from render25 branch)
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/threads.c
Modified: trunk/blender/source/blender/blenlib/intern/threads.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/threads.c 2010-06-22 15:12:00 UTC (rev 29621)
+++ trunk/blender/source/blender/blenlib/intern/threads.c 2010-06-22 15:17:12 UTC (rev 29622)
@@ -158,20 +158,20 @@
tslot->do_thread= do_thread;
tslot->avail= 1;
}
-
- if(thread_levels == 0) {
- MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
+ }
+
+ if(thread_levels == 0) {
+ MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
- /* workaround for Apple gcc 4.2.1 omp vs background thread bug,
- we copy gomp thread local storage pointer to setting it again
- inside the thread that we start */
- thread_tls_data = pthread_getspecific(gomp_tls_key);
+ /* workaround for Apple gcc 4.2.1 omp vs background thread bug,
+ we copy gomp thread local storage pointer to setting it again
+ inside the thread that we start */
+ thread_tls_data = pthread_getspecific(gomp_tls_key);
#endif
- }
+ }
- thread_levels++;
- }
+ thread_levels++;
}
/* amount of available threads */
@@ -287,11 +287,11 @@
}
}
BLI_freelistN(threadbase);
+ }
- thread_levels--;
- if(thread_levels==0)
- MEM_set_lock_callback(NULL, NULL);
- }
+ thread_levels--;
+ if(thread_levels==0)
+ MEM_set_lock_callback(NULL, NULL);
}
/* System Information */
More information about the Bf-blender-cvs
mailing list