[svn] / trunk / xvidcore / src / motion / motion_smp.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/motion/motion_smp.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1882, Tue Mar 9 09:20:05 2010 UTC revision 1883, Tue Mar 9 10:00:30 2010 UTC
# Line 22  Line 22 
22   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
23   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
24   *   *
25   * $Id: motion_smp.h,v 1.6 2009-06-05 07:58:41 Isibaar Exp $   * $Id: motion_smp.h,v 1.7 2010-03-09 10:00:14 Isibaar Exp $
26   *   *
27   ****************************************************************************/   ****************************************************************************/
28    
29  #ifndef SMP_MOTION_H  #ifndef SMP_MOTION_H
30  #define SMP_MOTION_H  #define SMP_MOTION_H
31    
 #ifdef WIN32  
   
 # include <windows.h>  
 # define pthread_t                              HANDLE  
 # define pthread_create(t,u,f,d) *(t)=CreateThread(NULL,0,f,d,0,NULL)  
 # define pthread_join(t,s)              { WaitForSingleObject(t,INFINITE); \  
                                                                         CloseHandle(t); }  
 # define sched_yield()                  Sleep(0);  
 static __inline int pthread_num_processors_np()  
 {  
         DWORD p_aff, s_aff, r = 0;  
         GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR) &p_aff, (PDWORD_PTR) &s_aff);  
         for(; p_aff != 0; p_aff>>=1) r += p_aff&1;  
         return r;  
 }  
   
 #elif defined(__amigaos4__)  
   
 # include <pthread.h>  
 # include <proto/dos.h>  
 # define sched_yield() IDOS->Delay(1)  
   
 #elif defined(SYS_BEOS)  
   
 # include <kernel/OS.h>  
 # define pthread_t                              thread_id  
 # define pthread_create(t,u,f,d) { *(t)=spawn_thread(f,"",10,d); \  
                                                                 resume_thread(*(t)); }  
 # define pthread_join(t,s)              wait_for_thread(t,(long*)s)  
 # define sched_yield()                  snooze(0) /* is this correct? */  
   
 #else  
 # include <pthread.h>  
 #endif  
   
32  typedef struct  typedef struct
33  {  {
34          pthread_t handle;               /* thread's handle */          pthread_t handle;               /* thread's handle */

Legend:
Removed from v.1882  
changed lines
  Added in v.1883

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4