28 pthread_mutexattr_t atts;
29 pthread_mutexattr_init (&atts);
30 pthread_mutexattr_settype (&atts, PTHREAD_MUTEX_RECURSIVE);
32 pthread_mutexattr_setprotocol (&atts, PTHREAD_PRIO_INHERIT);
34 pthread_mutex_init (&
lock, &atts);
35 pthread_mutexattr_destroy (&atts);
47 time.tv_sec = millisecs / 1000;
48 time.tv_nsec = (millisecs % 1000) * 1000000;
49 nanosleep (&time,
nullptr);
62#if JUCE_MAC || JUCE_LINUX || JUCE_BSD
63bool Process::setMaxNumberOfFileHandles (
int newMaxNumber)
noexcept
67 if (getrlimit (RLIMIT_NOFILE, &lim) == 0)
69 if (newMaxNumber <= 0 && lim.rlim_cur == RLIM_INFINITY && lim.rlim_max == RLIM_INFINITY)
72 if (newMaxNumber > 0 && lim.rlim_cur >= (rlim_t) newMaxNumber)
76 lim.rlim_cur = lim.rlim_max = newMaxNumber <= 0 ? RLIM_INFINITY : (rlim_t) newMaxNumber;
77 return setrlimit (RLIMIT_NOFILE, &lim) == 0;
80struct MaxNumFileHandlesInitialiser
82 MaxNumFileHandlesInitialiser()
noexcept
84 #ifndef JUCE_PREFERRED_MAX_FILE_HANDLES
85 enum { JUCE_PREFERRED_MAX_FILE_HANDLES = 8192 };
89 if (! Process::setMaxNumberOfFileHandles (0))
91 for (
int num = JUCE_PREFERRED_MAX_FILE_HANDLES; num > 256; num -= 1024)
92 if (Process::setMaxNumberOfFileHandles (num))
98static MaxNumFileHandlesInitialiser maxNumFileHandlesInitialiser;
102#if JUCE_ALLOW_STATIC_NULL_VARIABLES
106const juce_wchar File::separator =
'/';
107const StringRef File::separatorString (
"/");
122 char localBuffer[1024];
123 auto cwd = getcwd (localBuffer,
sizeof (localBuffer) - 1);
124 size_t bufferSize = 4096;
126 while (cwd ==
nullptr && errno == ERANGE)
128 heapBuffer.
malloc (bufferSize);
129 cwd = getcwd (heapBuffer, bufferSize - 1);
150 using juce_sigactionflags_type =
unsigned long;
152 using juce_sigactionflags_type =
int;
155 struct ::sigaction act;
156 (
void) ::sigaction (sig,
nullptr, &act);
159 act.sa_flags &=
static_cast<juce_sigactionflags_type
> (~SA_RESTART);
161 act.sa_flags |=
static_cast<juce_sigactionflags_type
> (SA_RESTART);
163 return ::sigaction (sig, &act,
nullptr);
170 #if JUCE_LINUX || (JUCE_IOS && ! __DARWIN_ONLY_64_BIT_INO_T)
171 using juce_statStruct =
struct stat64;
172 #define JUCE_STAT stat64
174 using juce_statStruct =
struct stat;
175 #define JUCE_STAT stat
178 bool juce_stat (
const String& fileName, juce_statStruct&
info)
186 bool juce_doStatFS (File
f,
struct statfs&
result)
188 for (
int i = 5; --
i >= 0;)
193 f =
f.getParentDirectory();
196 return statfs (
f.getFullPathName().toUTF8(), &
result) == 0;
199 #if JUCE_MAC || JUCE_IOS
200 static int64 getCreationTime (
const juce_statStruct&
s)
noexcept {
return (
int64)
s.st_birthtime; }
202 static int64 getCreationTime (
const juce_statStruct&
s)
noexcept {
return (
int64)
s.st_ctime; }
205 void updateStatInfoForFile (
const String& path,
bool* isDir,
int64* fileSize,
206 Time* modTime, Time* creationTime,
bool* isReadOnly)
208 if (isDir !=
nullptr || fileSize !=
nullptr || modTime !=
nullptr || creationTime !=
nullptr)
210 juce_statStruct
info;
211 const bool statOk = juce_stat (path,
info);
213 if (isDir !=
nullptr) *isDir = statOk && ((
info.st_mode & S_IFDIR) != 0);
214 if (fileSize !=
nullptr) *fileSize = statOk ? (
int64)
info.st_size : 0;
215 if (modTime !=
nullptr) *modTime =
Time (statOk ? (
int64)
info.st_mtime * 1000 : 0);
216 if (creationTime !=
nullptr) *creationTime =
Time (statOk ? getCreationTime (
info) * 1000 : 0);
219 if (isReadOnly !=
nullptr)
220 *isReadOnly = access (path.
toUTF8(), W_OK) != 0;
224 Result getResultForErrno()
229 Result getResultForReturnValue (
int value)
231 return value == -1 ? getResultForErrno() : Result::ok();
235 void* fdToVoidPointer (
int fd)
noexcept {
return (
void*) (
pointer_sized_int) fd; }
240 juce_statStruct
info;
249 && access (
fullPath.toUTF8(), F_OK) == 0;
259 juce_statStruct
info;
265 juce_statStruct
info;
271 #if JUCE_LINUX || JUCE_BSD
272 return geteuid() == 0;
283 || access (
fullPath.toUTF8(), W_OK) == 0);
294 && access (
fullPath.toUTF8(), R_OK) == 0;
299 juce_statStruct
info;
301 if (! juce_stat (fullPath,
info))
304 info.st_mode &= 0777;
311 return chmod (fullPath.toUTF8(), (mode_t)
info.st_mode) == 0;
327 modificationTime = 0;
331 juce_statStruct
info;
335 #if JUCE_MAC || (JUCE_IOS && __DARWIN_ONLY_64_BIT_INO_T)
336 modificationTime = (
int64)
info.st_mtimespec.tv_sec * 1000 +
info.st_mtimespec.tv_nsec / 1000000;
337 accessTime = (
int64)
info.st_atimespec.tv_sec * 1000 +
info.st_atimespec.tv_nsec / 1000000;
338 creationTime = (
int64)
info.st_birthtimespec.tv_sec * 1000 +
info.st_birthtimespec.tv_nsec / 1000000;
340 modificationTime = (
int64)
info.st_mtime * 1000;
341 accessTime = (
int64)
info.st_atime * 1000;
343 creationTime = (
int64)
info.st_birthtime * 1000;
345 creationTime = (
int64)
info.st_ctime * 1000;
354 juce_statStruct
info;
356 if ((modificationTime != 0 || accessTime != 0) && juce_stat (
fullPath,
info))
358 #if JUCE_MAC || (JUCE_IOS && __DARWIN_ONLY_64_BIT_INO_T)
359 struct timeval times[2];
361 bool setModificationTime = (modificationTime != 0);
362 bool setAccessTime = (accessTime != 0);
364 times[0].tv_sec = setAccessTime ?
static_cast<__darwin_time_t
> (accessTime / 1000)
365 :
info.st_atimespec.tv_sec;
367 times[0].tv_usec = setAccessTime ?
static_cast<__darwin_suseconds_t
> ((accessTime % 1000) * 1000)
368 :
static_cast<__darwin_suseconds_t
> (
info.st_atimespec.tv_nsec / 1000);
370 times[1].tv_sec = setModificationTime ?
static_cast<__darwin_time_t
> (modificationTime / 1000)
371 :
info.st_mtimespec.tv_sec;
373 times[1].tv_usec = setModificationTime ?
static_cast<__darwin_suseconds_t
> ((modificationTime % 1000) * 1000)
374 :
static_cast<__darwin_suseconds_t
> (
info.st_mtimespec.tv_nsec / 1000);
376 return utimes (
fullPath.toUTF8(), times) == 0;
378 struct utimbuf times;
379 times.actime = accessTime != 0 ?
static_cast<time_t
> (accessTime / 1000) :
static_cast<time_t
> (
info.st_atime);
380 times.modtime = modificationTime != 0 ?
static_cast<time_t
> (modificationTime / 1000) :
static_cast<time_t
> (
info.st_mtime);
382 return utime (
fullPath.toUTF8(), ×) == 0;
398 return rmdir (
fullPath.toUTF8()) == 0;
401 return remove (
fullPath.toUTF8()) == 0;
427 return getResultForReturnValue (mkdir (fileName.
toUTF8(), 0777));
441 auto f = open (
file.getFullPathName().toUTF8(), O_RDONLY);
446 status = getResultForErrno();
465 status = getResultForErrno();
478 auto f = open (
file.getFullPathName().toUTF8(), O_RDWR);
490 status = getResultForErrno();
496 status = getResultForErrno();
501 auto f = open (
file.getFullPathName().toUTF8(), O_RDWR | O_CREAT, 00644);
506 status = getResultForErrno();
527 status = getResultForErrno();
536 status = getResultForErrno();
564 if (
range.getStart() > 0)
566 auto pageSize = sysconf (_SC_PAGE_SIZE);
579 auto m = mmap (
nullptr, (
size_t)
range.getLength(),
587 madvise (
m, (
size_t)
range.getLength(), MADV_SEQUENTIAL);
614 static String getFilename()
619 dladdr (localSymbol, &exeInfo);
632 if (
const char*
const envpath =
::getenv (
"PATH"))
636 for (
int i=paths.
size(); --
i>=0;)
660 if (juce_doStatFS (*
this, buf))
661 return (
int64) buf.f_bsize * (
int64) buf.f_bavail;
670 if (juce_doStatFS (*
this, buf))
671 return (
int64) buf.f_bsize * (
int64) buf.f_blocks;
682 attrreference_t mountPointRef;
686 struct attrlist attrList;
688 attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
689 attrList.volattr = ATTR_VOL_INFO | ATTR_VOL_NAME;
695 if (getattrlist (
f.getFullPathName().toUTF8(), &attrList, &attrBuf, sizeof (attrBuf), 0) == 0)
696 return String::fromUTF8 (((
const char*) &attrBuf.mountPointRef) + attrBuf.mountPointRef.attr_dataoffset,
697 (
int) attrBuf.mountPointRef.attr_length);
699 auto parent =
f.getParentDirectory();
736 auto result = tempFile.loadFileAsString();
737 tempFile.deleteFile();
744class InterProcessLock::Pimpl
747 Pimpl (
const String&,
int) {}
760 if (!
createLockFile (
File (
"~/Library/Caches/com.juce.locks").getChildFile (lockName), timeOutMillisecs))
762 createLockFile (
File (
"/tmp/com.juce.locks").getChildFile (lockName), timeOutMillisecs);
765 File tempFolder (
"/var/tmp");
782 handle = open (
file.getFullPathName().toUTF8(), O_RDWR);
808 if (timeOutMillisecs == 0
831 while (! (fcntl (
handle, F_SETLKW, &fl) >= 0 || errno != EINTR))
855 if (
pimpl ==
nullptr)
859 if (
pimpl->handle == 0)
867 return pimpl !=
nullptr;
877 if (
pimpl !=
nullptr && --(
pimpl->refCount) == 0)
883extern JavaVM* androidJNIJavaVM;
888 auto* myself =
static_cast<Thread*
> (userData);
896 if (androidJNIJavaVM !=
nullptr)
899 androidJNIJavaVM->GetEnv(&env, JNI_VERSION_1_2);
903 androidJNIJavaVM->DetachCurrentThread();
910#if JUCE_ANDROID && JUCE_MODULE_AVAILABLE_juce_audio_devices && (JUCE_USE_ANDROID_OPENSLES || JUCE_USE_ANDROID_OBOE)
911 #define JUCE_ANDROID_REALTIME_THREAD_AVAILABLE 1
914#if JUCE_ANDROID_REALTIME_THREAD_AVAILABLE
915extern pthread_t juce_createRealtimeAudioThread (
void* (*entry) (
void*),
void* userPtr);
921 if (isAndroidRealtimeThread)
923 #if JUCE_ANDROID_REALTIME_THREAD_AVAILABLE
935 pthread_t handle = {};
937 pthread_attr_t* attrPtr =
nullptr;
939 if (pthread_attr_init (&attr) == 0)
948 pthread_detach (handle);
953 if (attrPtr !=
nullptr)
954 pthread_attr_destroy (attrPtr);
977 #if JUCE_IOS || JUCE_MAC
982 #elif JUCE_LINUX || JUCE_BSD || JUCE_ANDROID
984 || (JUCE_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012) \
985 || (JUCE_ANDROID && __ANDROID_API__ >= 9))
986 pthread_setname_np (pthread_self(),
name.toRawUTF8());
988 prctl (PR_SET_NAME,
name.toRawUTF8(), 0, 0, 0);
995 constexpr auto maxInputPriority = 10;
997 #if JUCE_LINUX || JUCE_BSD
998 constexpr auto lowestRrPriority = 8;
1000 constexpr auto lowestRrPriority = 0;
1003 struct sched_param param;
1006 if (handle ==
nullptr)
1007 handle = (
void*) pthread_self();
1009 if (pthread_getschedparam ((pthread_t) handle, &policy, ¶m) != 0)
1012 policy = priority < lowestRrPriority ? SCHED_OTHER : SCHED_RR;
1014 const auto minPriority = sched_get_priority_min (policy);
1015 const auto maxPriority = sched_get_priority_max (policy);
1017 param.sched_priority = [&]
1019 if (policy == SCHED_OTHER)
1022 return jmap (priority, lowestRrPriority, maxInputPriority, minPriority, maxPriority);
1025 return pthread_setschedparam ((pthread_t) handle, policy, ¶m) == 0;
1043#if defined (CPU_ISSET) && ! defined (SUPPORT_AFFINITIES)
1044 #define SUPPORT_AFFINITIES 1
1049 #if SUPPORT_AFFINITIES
1051 CPU_ZERO (&affinity);
1053 for (
int i = 0;
i < 32; ++
i)
1055 CPU_SET ((
size_t)
i, &affinity);
1057 #if (! JUCE_ANDROID) && ((! (JUCE_LINUX || JUCE_BSD)) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004))
1058 pthread_setaffinity_np (pthread_self(),
sizeof (cpu_set_t), &affinity);
1060 sched_setaffinity (gettid(),
sizeof (cpu_set_t), &affinity);
1065 sched_setaffinity (getpid(),
sizeof (cpu_set_t), &affinity);
1083 handle = dlopen (
name.isEmpty() ?
nullptr :
name.toUTF8().getAddress(), RTLD_LOCAL | RTLD_NOW);
1084 return handle !=
nullptr;
1098 return handle !=
nullptr ? dlsym (
handle, functionName.toUTF8()) :
nullptr;
1102#if JUCE_LINUX || JUCE_ANDROID
1103static String readPosixConfigFileValue (
const char*
file,
const char*
key)
1108 for (
int i = lines.
size(); --
i >= 0;)
1109 if (lines[
i].upToFirstOccurrenceOf (
":",
false,
false).trim().equalsIgnoreCase (
key))
1110 return lines[
i].fromFirstOccurrenceOf (
":",
false,
false).
trim();
1123 auto exe = arguments[0].unquoted();
1128 || ! exe.containsChar (File::getSeparatorChar()));
1130 int pipeHandles[2] = {};
1132 if (pipe (pipeHandles) == 0)
1135 for (
auto&
arg : arguments)
1136 if (
arg.isNotEmpty())
1137 argv.add (
const_cast<char*
> (
arg.toRawUTF8()));
1142 const pid_t
result = vfork();
1149 close (pipeHandles[0]);
1150 close (pipeHandles[1]);
1156 close (pipeHandles[0]);
1158 if ((streamFlags & wantStdOut) != 0)
1159 dup2 (pipeHandles[1], STDOUT_FILENO);
1161 dup2 (open (
"/dev/null", O_WRONLY), STDOUT_FILENO);
1163 if ((streamFlags & wantStdErr) != 0)
1164 dup2 (pipeHandles[1], STDERR_FILENO);
1166 dup2 (open (
"/dev/null", O_WRONLY), STDERR_FILENO);
1168 close (pipeHandles[1]);
1171 if (execvp (exe.toRawUTF8(),
argv.getRawDataPointer()) < 0)
1179 close (pipeHandles[1]);
1199 auto pid = waitpid (
childPID, &childState, WNOHANG);
1204 if (WIFEXITED (childState))
1206 exitCode = WEXITSTATUS (childState);
1210 return ! WIFSIGNALED (childState);
1213 int read (
void* dest,
int numBytes)
noexcept
1215 jassert (dest !=
nullptr && numBytes > 0);
1228 auto numBytesRead = (
int) fread (dest, 1, (
size_t) numBytes,
readHandle);
1231 return numBytesRead;
1246 return ::kill (
childPID, SIGKILL) == 0;
1257 auto pid = waitpid (
childPID, &childState, WNOHANG);
1259 if (pid >= 0 && WIFEXITED (childState))
1261 exitCode = WEXITSTATUS (childState);
1289 if (args.
size() == 0)
1292 activeProcess.reset (
new ActiveProcess (args, streamFlags));
1320 if (
thread.get_id() == std::this_thread::get_id())
1330 thread = std::thread ([
this, newPeriod]
1335 Clock clock (lastPeriod);
1337 std::unique_lock<std::mutex> unique_lock (
timerMutex);
1347 owner.hiResTimerCallback();
1351 if (lastPeriod != nextPeriod)
1353 lastPeriod = nextPeriod;
1354 clock =
Clock (lastPeriod);
1366 const auto thread_id =
thread.get_id();
1368 if (thread_id == std::thread::id() || thread_id == std::this_thread::get_id())
1372 std::unique_lock<std::mutex> unique_lock (
timerMutex);
1391 :
time (std::chrono::steady_clock::now()),
1392 delta (std::chrono::milliseconds (millis))
1395 bool wait (std::condition_variable& cond, std::unique_lock<std::mutex>& lock)
noexcept
1397 return cond.wait_until (lock,
time) != std::cv_status::timeout;
1406 std::chrono::time_point<std::chrono::steady_clock>
time;
1407 std::chrono::steady_clock::duration
delta;
1412 const auto thread = pthread_self();
1414 #if JUCE_MAC || JUCE_IOS
1415 mach_timebase_info_data_t timebase;
1416 mach_timebase_info (&timebase);
1418 const auto ticksPerMs = ((double) timebase.denom * 1000000.0) / (
double) timebase.numer;
1419 const auto periodTicks = (
uint32_t)
jmin ((
double) std::numeric_limits<uint32_t>::max(),
periodMs * ticksPerMs);
1421 thread_time_constraint_policy_data_t policy;
1422 policy.period = periodTicks;
1423 policy.computation =
jmin ((
uint32_t) 50000, policy.period);
1424 policy.constraint = policy.period;
1425 policy.preemptible =
true;
1427 return thread_policy_set (pthread_mach_thread_np (
thread),
1428 THREAD_TIME_CONSTRAINT_POLICY,
1429 (thread_policy_t) &policy,
1430 THREAD_TIME_CONSTRAINT_POLICY_COUNT) == KERN_SUCCESS;
1434 struct sched_param param;
1435 param.sched_priority = sched_get_priority_max (SCHED_RR);
1436 return pthread_setschedparam (
thread, SCHED_RR, ¶m) == 0;
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
#define noexcept
Definition DistrhoDefines.h:72
std::chrono::steady_clock Clock
Definition NulEngine.cpp:29
float arg(const fft_t *freqs, off_t x)
Definition OscilGen.cpp:58
#define MAXPATHLEN
Definition asiolist.h:9
int64_t int64
Definition basics.h:91
Definition juce_posix_SharedCode.h:1119
bool start(const String &command, Type type=TypeAny)
Definition ChildProcess.cpp:361
bool existsAsFile() const
Definition File.cpp:1320
static File getCurrentWorkingDirectory()
Definition File.cpp:1395
bool deleteFile() const
Definition File.cpp:1358
void getFileTimesInternal(int64 &m, int64 &a, int64 &c) const
Definition File.cpp:1336
bool moveInternal(const File &) const
Definition File.cpp:1369
bool setFileReadOnlyInternal(bool) const
bool setAsCurrentWorkingDirectory() const
Definition File.cpp:1414
bool exists() const
Definition File.cpp:1314
bool isDirectory() const
Definition File.cpp:1306
int64 getSize() const
Definition File.cpp:1352
bool setFileExecutableInternal(bool) const
bool replaceInternal(const File &) const
Definition File.cpp:1385
Result createDirectoryInternal(const String &) const
Definition File.cpp:1390
static File getSpecialLocation(const SpecialLocationType type)
Definition File.cpp:1642
bool hasWriteAccess() const
Definition File.cpp:1325
static Result fail(const std::string &errorMessage) noexcept
Definition Result.cpp:58
CharPointer_UTF8 toUTF8() const
Definition String.cpp:1906
bool isNotEmpty() const noexcept
Definition String.h:244
static String fromUTF8(const char *utf8buffer, int bufferSizeBytes=-1)
Definition String.cpp:1961
Definition juce_CharPointer_UTF8.h:35
Definition juce_posix_SharedCode.h:1119
int read(void *dest, int numBytes) noexcept
Definition juce_posix_SharedCode.h:1213
int getPID() const noexcept
Definition juce_posix_SharedCode.h:1269
FILE * readHandle
Definition juce_posix_SharedCode.h:1277
uint32 getExitCode() noexcept
Definition juce_posix_SharedCode.h:1249
int childPID
Definition juce_posix_SharedCode.h:1274
~ActiveProcess()
Definition juce_posix_SharedCode.h:1184
ActiveProcess(const StringArray &arguments, int streamFlags)
Definition juce_posix_SharedCode.h:1121
bool killProcess() const noexcept
Definition juce_posix_SharedCode.h:1244
bool isRunning() noexcept
Definition juce_posix_SharedCode.h:1193
int exitCode
Definition juce_posix_SharedCode.h:1276
int pipeHandle
Definition juce_posix_SharedCode.h:1275
std::unique_ptr< ActiveProcess > activeProcess
Definition juce_ChildProcess.h:109
bool tryEnter() const noexcept
Definition juce_posix_SharedCode.h:40
~CriticalSection() noexcept
Definition juce_posix_SharedCode.h:38
CriticalSection() noexcept
Definition juce_posix_SharedCode.h:26
pthread_mutex_t lock
Definition juce_CriticalSection.h:114
void enter() const noexcept
Definition juce_posix_SharedCode.h:39
void exit() const noexcept
Definition juce_posix_SharedCode.h:41
void * getFunction(const String &functionName) noexcept
Definition juce_posix_SharedCode.h:1096
void * handle
Definition juce_DynamicLibrary.h:81
bool open(const String &name)
Definition juce_posix_SharedCode.h:1080
void close()
Definition juce_posix_SharedCode.h:1087
Definition juce_File.h:45
int getVolumeSerialNumber() const
Definition juce_posix_SharedCode.h:711
bool isSymbolicLink() const
Definition juce_linux_CommonFile.cpp:58
bool copyInternal(const File &) const
Definition juce_linux_CommonFile.cpp:26
bool isDirectory() const
Definition juce_posix_SharedCode.h:238
static StringRef getSeparatorString()
Definition juce_posix_SharedCode.h:114
int64 getVolumeTotalSize() const
Definition juce_posix_SharedCode.h:666
int64 getBytesFreeOnVolume() const
Definition juce_posix_SharedCode.h:656
bool hasWriteAccess() const
Definition juce_posix_SharedCode.h:279
bool existsAsFile() const
Definition juce_posix_SharedCode.h:252
String fullPath
Definition juce_File.h:1147
const String & getFullPathName() const noexcept
Definition juce_File.h:153
File getChildFile(StringRef relativeOrAbsolutePath) const
Definition juce_File.cpp:412
void readLines(StringArray &destLines) const
Definition juce_File.cpp:558
static bool isAbsolutePath(StringRef path)
Definition juce_File.cpp:400
@ tempDirectory
Definition juce_File.h:913
File getNonexistentChildFile(const String &prefix, const String &suffix, bool putNumbersInBrackets=true) const
Definition juce_File.cpp:601
bool moveInternal(const File &) const
Definition juce_posix_SharedCode.h:404
bool hasReadAccess() const
Definition juce_posix_SharedCode.h:291
File getParentDirectory() const
Definition juce_File.cpp:358
String getVolumeLabel() const
Definition juce_posix_SharedCode.h:676
bool setFileTimesInternal(int64 m, int64 a, int64 c) const
Definition juce_posix_SharedCode.h:351
uint64 getFileIdentifier() const
Definition juce_posix_SharedCode.h:263
static juce_wchar getSeparatorChar()
Definition juce_posix_SharedCode.h:113
bool deleteFile() const
Definition juce_posix_SharedCode.h:390
bool exists() const
Definition juce_posix_SharedCode.h:246
ssize_t writeInternal(const void *, size_t)
Definition juce_posix_SharedCode.h:519
File file
Definition juce_FileOutputStream.h:109
int64 currentPosition
Definition juce_FileOutputStream.h:112
void openHandle()
Definition juce_posix_SharedCode.h:474
bool write(const void *, size_t) override
Definition juce_FileOutputStream.cpp:76
void flushInternal()
Definition juce_posix_SharedCode.h:533
void * fileHandle
Definition juce_FileOutputStream.h:110
Result status
Definition juce_FileOutputStream.h:111
Result truncate()
Definition juce_posix_SharedCode.h:540
void closeHandle()
Definition juce_posix_SharedCode.h:510
Definition juce_HeapBlock.h:87
void malloc(SizeType newNumElements, size_t elementSize=sizeof(ElementType))
Definition juce_HeapBlock.h:252
Definition juce_posix_SharedCode.h:1388
void next() noexcept
Definition juce_posix_SharedCode.h:1400
std::chrono::steady_clock::duration delta
Definition juce_posix_SharedCode.h:1407
Clock(std::chrono::steady_clock::rep millis) noexcept
Definition juce_posix_SharedCode.h:1390
bool wait(std::condition_variable &cond, std::unique_lock< std::mutex > &lock) noexcept
Definition juce_posix_SharedCode.h:1395
std::chrono::time_point< std::chrono::steady_clock > time
Definition juce_posix_SharedCode.h:1406
HighResolutionTimer()
Definition juce_HighResolutionTimer.cpp:26
Definition juce_posix_SharedCode.h:755
Pimpl(const String &lockName, int timeOutMillisecs)
Definition juce_posix_SharedCode.h:757
int handle
Definition juce_posix_SharedCode.h:839
void closeFile()
Definition juce_posix_SharedCode.h:821
bool createLockFile(const File &file, int timeOutMillisecs)
Definition juce_posix_SharedCode.h:779
~Pimpl()
Definition juce_posix_SharedCode.h:774
int refCount
Definition juce_posix_SharedCode.h:839
void close()
Definition juce_win32_Threads.cpp:343
std::unique_ptr< Pimpl > pimpl
Definition juce_InterProcessLock.h:113
~InterProcessLock()
Definition juce_posix_SharedCode.h:847
void exit()
Definition juce_posix_SharedCode.h:870
String name
Definition juce_InterProcessLock.h:116
bool enter(int timeOutMillisecs=-1)
Definition juce_posix_SharedCode.h:851
CriticalSection lock
Definition juce_InterProcessLock.h:115
InterProcessLock(const String &name)
Definition juce_posix_SharedCode.h:843
~MemoryMappedFile()
Definition juce_posix_SharedCode.h:599
void openInternal(const File &, AccessMode, bool)
Definition juce_posix_SharedCode.h:560
Range< int64 > range
Definition juce_MemoryMappedFile.h:102
int fileHandle
Definition juce_MemoryMappedFile.h:107
void * address
Definition juce_MemoryMappedFile.h:101
AccessMode
Definition juce_MemoryMappedFile.h:37
@ readWrite
Definition juce_MemoryMappedFile.h:39
@ readOnly
Definition juce_MemoryMappedFile.h:38
static void JUCE_CALLTYPE terminate()
Definition juce_posix_SharedCode.h:52
static Random & getSystemRandom() noexcept
Definition juce_Random.cpp:67
Definition juce_Range.h:40
Definition juce_Result.h:57
Definition juce_StringArray.h:35
static StringArray fromTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
Definition juce_StringArray.cpp:387
int size() const noexcept
Definition juce_StringArray.h:136
void trim()
Definition juce_StringArray.cpp:266
Definition juce_String.h:53
static String toHexString(IntegerType number)
Definition juce_String.h:1097
CharPointer_UTF8 toUTF8() const
Definition juce_String.cpp:2070
Definition juce_StringRef.h:62
static String getEnvironmentVariable(const String &name, const String &defaultValue)
Definition juce_posix_SharedCode.h:550
Definition juce_Thread.h:43
size_t threadStackSize
Definition juce_Thread.h:391
static void JUCE_CALLTYPE setCurrentThreadAffinityMask(uint32 affinityMask)
Definition juce_posix_SharedCode.h:1047
void * ThreadID
Definition juce_Thread.h:304
Atomic< void * > threadHandle
Definition juce_Thread.h:386
void launchThread()
Definition juce_posix_SharedCode.h:918
static void JUCE_CALLTYPE yield()
Definition juce_posix_SharedCode.h:1033
void killThread()
Definition juce_posix_SharedCode.h:963
static ThreadID JUCE_CALLTYPE getCurrentThreadId()
Definition juce_posix_SharedCode.h:1028
static bool setThreadPriority(void *, int)
Definition juce_posix_SharedCode.h:993
static void JUCE_CALLTYPE setCurrentThreadName(const String &newThreadName)
Definition juce_posix_SharedCode.h:975
Atomic< ThreadID > threadId
Definition juce_Thread.h:387
void closeThreadHandle()
Definition juce_posix_SharedCode.h:957
uint32 affinityMask
Definition juce_Thread.h:392
static void JUCE_CALLTYPE sleep(int milliseconds)
Definition juce_posix_SharedCode.h:44
static int64 currentTimeMillis() noexcept
Definition juce_Time.cpp:220
static File getCurrentWorkingDirectory()
Definition File.cpp:1395
File getChildFile(StringRef relativeOrAbsolutePath) const
Definition File.cpp:418
const String & getFullPathName() const noexcept
Definition File.h:152
Definition StringArray.h:41
unsigned * m
Definition inflate.c:1559
struct huft * t
Definition inflate.c:943
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned f
Definition inflate.c:1572
static char filename[]
Definition features.c:5
static PuglViewHint int value
Definition pugl.h:1708
char * argv[]
Definition unzip.c:738
static const char * name
Definition pugl.h:1582
static uintptr_t parent
Definition pugl.h:1644
virtual ASIOError stop()=0
virtual ASIOError start()=0
CARLA_PLUGIN_EXPORT pid_t fork()
Definition interposer-safe.cpp:38
#define EXIT_FAILURE
Definition jerror.c:32
struct backing_store_struct * info
Definition jmemsys.h:183
JSAMPIMAGE data
Definition jpeglib.h:945
#define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...)
Definition juce_CompilerWarnings.h:181
#define JUCE_END_IGNORE_WARNINGS_GCC_LIKE
Definition juce_CompilerWarnings.h:182
#define JUCE_AUTORELEASEPOOL
Definition juce_Memory.h:158
#define JUCE_STAT
Definition juce_posix_SharedCode.h:175
unsigned int uint32_t
Definition mid.cpp:100
Definition carla_juce.cpp:31
void zerostruct(Type &structure) noexcept
Definition juce_Memory.h:32
int juce_siginterrupt(int sig, int flag)
Definition juce_posix_SharedCode.h:143
CriticalSection::ScopedLockType ScopedLock
Definition juce_CriticalSection.h:186
File juce_getExecutableFile()
Definition juce_posix_SharedCode.h:610
int64 juce_fileSetPosition(void *handle, int64 pos)
Definition juce_posix_SharedCode.h:431
unsigned long long uint64
Definition juce_MathsFunctions.h:56
constexpr Type jmap(Type value0To1, Type targetRangeMin, Type targetRangeMax)
Definition juce_MathsFunctions.h:120
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
static bool hasEffectiveRootFilePermissions()
Definition juce_posix_SharedCode.h:269
unsigned int uint32
Definition juce_MathsFunctions.h:45
String juce_getOutputFromCommand(const String &)
Definition juce_posix_SharedCode.h:728
long long int64
Definition juce_MathsFunctions.h:54
wchar_t juce_wchar
Definition juce_CharacterFunctions.h:42
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
NSString * juceStringToNS(const String &s)
Definition juce_mac_ObjCHelpers.h:47
static bool setFileModeFlags(const String &fullPath, mode_t flags, bool shouldSet) noexcept
Definition juce_posix_SharedCode.h:297
static void * threadEntryProc(void *userData)
Definition juce_posix_SharedCode.h:886
void juce_runSystemCommand(const String &)
Definition juce_posix_SharedCode.h:721
int pointer_sized_int
Definition juce_MathsFunctions.h:80
@ exclusive
Definition juce_audio_devices.h:176
void JUCE_API juce_threadEntryPoint(void *userData)
Definition juce_Thread.cpp:116
jack_client_t client jack_client_t client jack_client_t client jack_client_t JackInfoShutdownCallback void arg jack_client_t jack_port_t port void func jack_client_t const char const char unsigned long flags
Definition juce_linux_JackAudio.cpp:69
@ Time
Definition LadspaBase.h:49
unsigned int uint32
Definition water.h:98
png_uint_32 length
Definition png.c:2247
png_structrp int mode
Definition png.h:1139
Definition juce_posix_SharedCode.h:1304
std::condition_variable stopCond
Definition juce_posix_SharedCode.h:1384
std::thread thread
Definition juce_posix_SharedCode.h:1383
static bool setThisThreadToRealtime(uint64 periodMs)
Definition juce_posix_SharedCode.h:1410
void start(int newPeriod)
Definition juce_posix_SharedCode.h:1315
~Pimpl()
Definition juce_posix_SharedCode.h:1309
std::mutex timerMutex
Definition juce_posix_SharedCode.h:1385
Pimpl(HighResolutionTimer &t)
Definition juce_posix_SharedCode.h:1305
std::atomic< int > periodMs
Definition juce_posix_SharedCode.h:1380
HighResolutionTimer & owner
Definition juce_posix_SharedCode.h:1379
void stop()
Definition juce_posix_SharedCode.h:1362
#define off_t
Definition thread-link.cpp:7
ZCONST char * key
Definition crypt.c:587
int flush(__G__ rawbuf, size, unshrink) __GDEF uch *rawbuf
int result
Definition process.c:1455
int flag
Definition unix.c:754
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
#define SEEK_SET
Definition unzpriv.h:1302
#define SEEK_END
Definition unzpriv.h:1304
struct zdirent * file
Definition win32.c:1500
#define const
Definition zconf.h:137