Mercurial > hg > svcore
comparison system/System.h @ 835:1d439494604c
Memory barriers in ringbuffer
author | Chris Cannam |
---|---|
date | Mon, 16 Sep 2013 15:47:27 +0100 |
parents | 001d77a720ce |
children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
834:fcee7e040ab4 | 835:1d439494604c |
---|---|
27 | 27 |
28 #define MLOCK(a,b) 1 | 28 #define MLOCK(a,b) 1 |
29 #define MUNLOCK(a,b) 1 | 29 #define MUNLOCK(a,b) 1 |
30 #define MUNLOCK_SAMPLEBLOCK(a) 1 | 30 #define MUNLOCK_SAMPLEBLOCK(a) 1 |
31 #define MUNLOCKALL() 1 | 31 #define MUNLOCKALL() 1 |
32 | |
33 extern void SystemMemoryBarrier(); | |
34 #define MBARRIER() SystemMemoryBarrier() | |
32 | 35 |
33 #define DLOPEN(a,b) LoadLibrary((a).toStdWString().c_str()) | 36 #define DLOPEN(a,b) LoadLibrary((a).toStdWString().c_str()) |
34 #define DLSYM(a,b) GetProcAddress((HINSTANCE)(a),(b)) | 37 #define DLSYM(a,b) GetProcAddress((HINSTANCE)(a),(b)) |
35 #define DLCLOSE(a) (!FreeLibrary((HINSTANCE)(a))) | 38 #define DLCLOSE(a) (!FreeLibrary((HINSTANCE)(a))) |
36 #define DLERROR() "" | 39 #define DLERROR() "" |
97 #define DEFAULT_LADSPA_PATH "$HOME/Library/Audio/Plug-Ins/LADSPA:/Library/Audio/Plug-Ins/LADSPA" | 100 #define DEFAULT_LADSPA_PATH "$HOME/Library/Audio/Plug-Ins/LADSPA:/Library/Audio/Plug-Ins/LADSPA" |
98 #define DEFAULT_DSSI_PATH "$HOME/Library/Audio/Plug-Ins/DSSI:/Library/Audio/Plug-Ins/DSSI" | 101 #define DEFAULT_DSSI_PATH "$HOME/Library/Audio/Plug-Ins/DSSI:/Library/Audio/Plug-Ins/DSSI" |
99 | 102 |
100 #define MUNLOCKALL() 1 | 103 #define MUNLOCKALL() 1 |
101 | 104 |
105 #include <libkern/OSAtomic.h> | |
106 #define MBARRIER() OSMemoryBarrier() | |
107 | |
102 #else | 108 #else |
103 | 109 |
104 #ifdef sun | 110 #ifdef sun |
105 #undef MLOCK | 111 #undef MLOCK |
106 #undef MUNLOCK | 112 #undef MUNLOCK |
120 #define DEFAULT_LADSPA_PATH "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa" | 126 #define DEFAULT_LADSPA_PATH "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa" |
121 #define DEFAULT_DSSI_PATH "$HOME/dssi:$HOME/.dssi:/usr/local/lib/dssi:/usr/lib/dssi" | 127 #define DEFAULT_DSSI_PATH "$HOME/dssi:$HOME/.dssi:/usr/local/lib/dssi:/usr/lib/dssi" |
122 | 128 |
123 #define MUNLOCKALL() ::munlockall() | 129 #define MUNLOCKALL() ::munlockall() |
124 | 130 |
125 #endif /* __APPLE__ */ | 131 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) |
132 #define MBARRIER() __sync_synchronize() | |
133 #else | |
134 extern void SystemMemoryBarrier(); | |
135 #define MBARRIER() SystemMemoryBarrier() | |
136 #endif | |
137 | |
138 #endif /* ! __APPLE__ */ | |
126 | 139 |
127 #endif /* ! _WIN32 */ | 140 #endif /* ! _WIN32 */ |
128 | 141 |
129 enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; | 142 enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; |
130 extern ProcessStatus GetProcessStatus(int pid); | 143 extern ProcessStatus GetProcessStatus(int pid); |