summaryrefslogtreecommitdiff
path: root/plugins/FTPFileYM/src/job_upload.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-23 21:53:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-23 21:53:52 +0000
commit1e089e1f91c7280712d03947d60c0d922a414c34 (patch)
tree0baeff1d89a5195c5327d3d03b16fc112d163750 /plugins/FTPFileYM/src/job_upload.cpp
parent42f33aaf630e67c1b25d6cf9ca2ba1886e88d2f6 (diff)
FTPFile to use standard locks
git-svn-id: http://svn.miranda-ng.org/main/trunk@13806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FTPFileYM/src/job_upload.cpp')
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index ac490cf5a9..ace85a52a6 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
Event UploadJob::jobDone;
-Mutex UploadJob::mutexJobCount;
+mir_cs UploadJob::mutexJobCount;
int UploadJob::iRunningJobCount = 0;
extern UploadDialog *uDlg;
@@ -149,24 +149,24 @@ void UploadJob::waitingThread(void *arg)
UploadJob *job = (UploadJob *)arg;
while (!Miranda_Terminated()) {
- Lock *lock = new Lock(mutexJobCount);
+ mir_cslockfull lock(mutexJobCount);
if (iRunningJobCount < MAX_RUNNING_JOBS) {
iRunningJobCount++;
- delete lock;
+ lock.unlock();
job->upload();
if (!job->isCompleted())
delete job;
- Lock *lock = new Lock(mutexJobCount);
+ lock.lock();
iRunningJobCount--;
- delete lock;
+ lock.unlock();
jobDone.release();
return;
}
- delete lock;
+ lock.unlock();
jobDone.wait();
job->status = GenericJob::STATUS_WAITING;
}