diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-01-23 14:25:20 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-01-23 14:25:20 +0300 |
commit | 7ef85aa41ff57cbe5395f83d4ea23b651287b78d (patch) | |
tree | 60e950948108158c752675fe4f68dbc1663996d4 /source/blender/blenlib/intern/threads.c | |
parent | f66d5a7b77d0f7a1eb2d530cb58509e52554b8e9 (diff) |
Initial results of my profiling of the animation system.
Basically two simple changes, changes, I pulled in the faster
ghash in bmesh (which uses mempools for allocation, providing
a substanstial speedup in some cases, and also I inlined some
of the functions), and I changed __inline to __forceinline for inlining
of math functions.
I also removed the timer in the view3d zoom op (ctrl-middlemouse)
that was making it nonfunctional. Why was that there?
Diffstat (limited to 'source/blender/blenlib/intern/threads.c')
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 9df746276bd..ad89a61a2a7 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -524,6 +524,7 @@ void *BLI_thread_queue_pop(ThreadQueue *queue) static void wait_timeout(struct timespec *timeout, int ms) { +#ifndef WIN32 struct timeval now; ldiv_t div_result; long x; @@ -539,6 +540,23 @@ static void wait_timeout(struct timespec *timeout, int ms) } timeout->tv_nsec = x*1000; +#else + time_t now; + ldiv_t div_result; + long x; + + time(&now); + div_result = ldiv(ms, 1000); + timeout->tv_sec = now + div_result.quot; + x = (now*1000) + (div_result.rem*1000); + + if (x >= 1000000) { + timeout->tv_sec++; + x -= 1000000; + } + + timeout->tv_nsec = x*1000; +#endif } void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms) |