Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uwr original/povray-3.7.0.beta.40/source/backend/frame.h new/povray-3.7.0.beta.40/source/backend/frame.h
- --- original/povray-3.7.0.beta.40/source/backend/frame.h 2010-12-06 12:55:33.000000000 +0100
- +++ new/povray-3.7.0.beta.40/source/backend/frame.h 2010-12-21 23:42:36.000000000 +0100
- @@ -96,6 +96,9 @@
- // Generic header for all modules
- +#include <pthread.h>
- +
- +
- #include <new>
- #include <stdio.h>
- @@ -1898,10 +1901,48 @@
- // you'll need to fix your platform-specific config to provide a means to declare
- // thread-local variables. support for TLS is required for efficient access by the
- // render threads to their stats and cache data.
- +
- +
- #ifndef DECLARE_THREAD_LOCAL_PTR
- -#define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName) __thread ptrType *ptrName;
- -#endif
- +#ifdef __APPLE__
- +template<typename T>
- +class Pthread_Thread_Local_Pointer
- +{
- + public:
- + Pthread_Thread_Local_Pointer()
- + {
- + pthread_key_create(&m_key, NULL);
- + }
- +
- + Pthread_Thread_Local_Pointer& operator=(T* ptr)
- + {
- + pthread_setspecific(m_key, ptr);
- + return *this;
- + };
- + bool operator!=(T* rhs)
- + {
- + return pthread_getspecific(m_key) != rhs;
- + }
- +
- + T* operator->() const
- + {
- + return static_cast<T*>(pthread_getspecific(m_key));
- + }
- +
- + operator T*() const
- + {
- + return static_cast<T*>(pthread_getspecific(m_key));
- + }
- +
- + private:
- + pthread_key_t m_key;
- +};
- +#define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName) Pthread_Thread_Local_Pointer<ptrType> ptrName;
- +#else
- +#efine DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName) __thread ptrType *ptrName;
- +#endif
- +#endif
- }
- #endif
- diff -uwr original/povray-3.7.0.beta.40/vfe/vfesession.h new/povray-3.7.0.beta.40/vfe/vfesession.h
- --- original/povray-3.7.0.beta.40/vfe/vfesession.h 2010-12-06 12:55:33.000000000 +0100
- +++ new/povray-3.7.0.beta.40/vfe/vfesession.h 2010-12-21 22:36:54.000000000 +0100
- @@ -94,6 +94,8 @@
- #ifndef __VFESESSION_H__
- #define __VFESESSION_H__
- +#include <sys/types.h>
- +
- #include <queue>
- namespace vfe
Advertisement
Add Comment
Please, Sign In to add comment