Documentation for Synchronisation primitives
Former-commit-id: 39f86b2f9cd1f44a6b8e52101458f090183707e4
This commit is contained in:
@@ -18,8 +18,8 @@ namespace Nz
|
||||
|
||||
void FileImpl::Close()
|
||||
{
|
||||
if (m_fileDescriptor != -1)
|
||||
close(m_fileDescriptor);
|
||||
if (m_fileDescriptor != -1)
|
||||
close(m_fileDescriptor);
|
||||
}
|
||||
|
||||
bool FileImpl::EndOfFile() const
|
||||
@@ -62,16 +62,16 @@ namespace Nz
|
||||
flags = O_CREAT | O_WRONLY;
|
||||
else
|
||||
return false;
|
||||
|
||||
|
||||
if (mode & OpenMode_Append)
|
||||
flags |= O_APPEND;
|
||||
|
||||
if (mode & OpenMode_Truncate)
|
||||
flags |= O_TRUNC;
|
||||
|
||||
///TODO: lock
|
||||
// if ((mode & OpenMode_Lock) == 0)
|
||||
// shareMode |= FILE_SHARE_WRITE;
|
||||
///TODO: lock
|
||||
//if ((mode & OpenMode_Lock) == 0)
|
||||
// shareMode |= FILE_SHARE_WRITE;
|
||||
|
||||
m_fileDescriptor = open64(filePath.GetConstBuffer(), flags, permissions);
|
||||
return m_fileDescriptor != -1;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Nz
|
||||
{
|
||||
SemaphoreImpl::SemaphoreImpl(unsigned int count)
|
||||
{
|
||||
if(sem_init(&m_semaphore, 0, count) != 0)
|
||||
if (sem_init(&m_semaphore, 0, count) != 0)
|
||||
NazaraError("Failed to create semaphore: " + Error::GetLastSystemError());
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Nz
|
||||
|
||||
return true;
|
||||
#else
|
||||
return sem_timedwait(&m_semaphore, &ti) != 0;
|
||||
return sem_timedwait(&m_semaphore, &ti) != 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user