Changeset 868c8b


Ignore:
Timestamp:
02/03/12 15:52:15 (3 months ago)
Author:
Micke Prag <micke.prag@…>
Branches:
('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
Children:
12506815144a25f959a1c78776ad82fa8970b5a3
Parents:
ceec23dfed3ad0e67cef7e12bc29ef881880a79f
git-author:
Micke Prag <micke.prag@telldus.se>2012-02-03 15:52:15+01:00
git-committer:
Micke Prag <micke.prag@telldus.se>2012-02-03 15:52:15+01:00
Message:

The mutex must be locked and unlocked by the same thread. We easily get deadlocks in Windows otherwise

File:
1 edited

Legend:

Unmodified
Added
Removed
  • telldus-core/client/CallbackDispatcher.cpp

    r6cbdac r868c8b  
    1616:Thread(), d(data), deviceId(id), method(m), strData(strD), doneRunning(false) 
    1717{ 
    18         d->mutex.lock(); 
    19         this->start(); 
     18        this->startAndLock(&d->mutex); 
    2019} 
    2120 
     
    3332 
    3433        doneRunning = true; 
    35         d->mutex.unlock(); 
    3634} 
    3735 
     
    4038:Thread(), d(data), deviceId(id), changeEvent(event), changeType(type), doneRunning(false) 
    4139{ 
    42         d->mutex.lock(); 
    43         this->start(); 
     40        this->startAndLock(&d->mutex); 
    4441} 
    4542 
     
    5552        d->event(deviceId, changeEvent, changeType, d->id, d->context); 
    5653        doneRunning = true; 
    57         d->mutex.unlock(); 
    5854} 
    5955 
     
    6157:Thread(), d(data), controllerId(id), strData(strD), doneRunning(false) 
    6258{ 
    63         d->mutex.lock(); 
    64         this->start(); 
     59        this->startAndLock(&d->mutex); 
    6560} 
    6661 
     
    7671        d->event(strData.c_str(), controllerId, d->id, d->context); 
    7772        doneRunning = true; 
    78         d->mutex.unlock(); 
    7973} 
    8074 
     
    8276        :Thread(), d(data), protocol(p), model(m), sensorId(id), dataType(type), value(v), timestamp(t), doneRunning(false) 
    8377{ 
    84         d->mutex.lock(); 
    85         this->start(); 
     78        this->startAndLock(&d->mutex); 
    8679} 
    8780 
     
    9790        d->event(protocol.c_str(), model.c_str(), sensorId, dataType, value.c_str(), timestamp, d->id, d->context); 
    9891        doneRunning = true; 
    99         d->mutex.unlock(); 
    10092} 
Note: See TracChangeset for help on using the changeset viewer.