Replaced pthread with std:: thread and mutex

This commit is contained in:
Jean-Francois Dockes
2016-07-12 18:08:21 +02:00
parent d8f215b6ed
commit c1fad4afc7
33 changed files with 367 additions and 633 deletions
+4 -4
View File
@@ -50,14 +50,14 @@
extern RclConfig *theconfig;
PTMutexInit thetempfileslock;
std::mutex thetempfileslock;
static vector<TempFile> o_tempfiles;
/* Keep an array of temporary files for deletion at exit. It happens that we
erase some of them before exiting (ie: when closing a preview tab), we don't
reuse the array holes for now */
void rememberTempFile(TempFile temp)
{
PTMutexLocker locker(thetempfileslock);
std::unique_lock<std::mutex> locker(thetempfileslock);
o_tempfiles.push_back(temp);
}
@@ -65,7 +65,7 @@ void forgetTempFile(string &fn)
{
if (fn.empty())
return;
PTMutexLocker locker(thetempfileslock);
std::unique_lock<std::mutex> locker(thetempfileslock);
for (vector<TempFile>::iterator it = o_tempfiles.begin();
it != o_tempfiles.end(); it++) {
if ((*it) && !fn.compare((*it)->filename())) {
@@ -77,7 +77,7 @@ void forgetTempFile(string &fn)
void deleteAllTempFiles()
{
PTMutexLocker locker(thetempfileslock);
std::unique_lock<std::mutex> locker(thetempfileslock);
o_tempfiles.clear();
}
-1
View File
@@ -22,7 +22,6 @@
#include "rclconfig.h"
#include "rcldb.h"
#include "rclutil.h"
#include "ptmutex.h"
#include <QString>