Subversion Repositories tpanel

Rev

Rev 367 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 367 Rev 443
Line 14... Line 14...
14
 * You should have received a copy of the GNU General Public License
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
17
 */
18
 
18
 
-
 
19
#include "tlock.h"
19
#include <vector>
20
#include <vector>
20
#include <thread>
21
#include <thread>
21
 
22
 
22
#include "terror.h"
23
#include "terror.h"
23
 
24
 
Line 129... Line 130...
129
            iter->noDeathLock = false;
130
            iter->noDeathLock = false;
130
            _M_device.unlock();
131
            _M_device.unlock();
131
 
132
 
132
            if (mFilename.empty())
133
            if (mFilename.empty())
133
            {
134
            {
134
                MSG_PROTOCOL("The mutex handle " << iter->native_handle << " was released!");
135
                MSG_DEBUG("The mutex handle " << iter->native_handle << " was released!");
135
            }
136
            }
136
            else
137
            else
137
            {
138
            {
138
                MSG_PROTOCOL("The mutex handle " << iter->native_handle << " was released on file " << mFilename << " at line " << mLineNumber << "!");
139
                MSG_DEBUG("The mutex handle " << iter->native_handle << " was released on file " << mFilename << " at line " << mLineNumber << "!");
139
            }
140
            }
140
 
141
 
141
            return;
142
            return;
142
        }
143
        }
143
    }
144
    }
Line 229... Line 230...
229
    {
230
    {
230
        _locks.push_back(lc);
231
        _locks.push_back(lc);
231
 
232
 
232
        if (mFilename.empty())
233
        if (mFilename.empty())
233
        {
234
        {
234
            MSG_PROTOCOL("Lock for mutex handle " << lc.native_handle << " was added.");
235
            MSG_DEBUG("Lock for mutex handle " << lc.native_handle << " was added.");
235
        }
236
        }
236
        else
237
        else
237
        {
238
        {
238
            MSG_PROTOCOL("Lock for mutex handle " << lc.native_handle << " was added on file " << mFilename << " at line " << mLineNumber << ".");
239
            MSG_DEBUG("Lock for mutex handle " << lc.native_handle << " was added on file " << mFilename << " at line " << mLineNumber << ".");
239
        }
240
        }
240
 
241
 
241
        if (death)
242
        if (death)
242
            *death = lc.noDeathLock;
243
            *death = lc.noDeathLock;
243
 
244
 
Line 284... Line 285...
284
            {
285
            {
285
                iter->state = true;
286
                iter->state = true;
286
 
287
 
287
                if (mFilename.empty())
288
                if (mFilename.empty())
288
                {
289
                {
289
                    MSG_PROTOCOL("Lock for mutex handle " << iter->native_handle << " was reactivated.");
290
                    MSG_DEBUG("Lock for mutex handle " << iter->native_handle << " was reactivated.");
290
                }
291
                }
291
                else
292
                else
292
                {
293
                {
293
                    MSG_PROTOCOL("Lock for mutex handle " << iter->native_handle << " was reactivated on file " << mFilename << " at line " << mLineNumber << ".");
294
                    MSG_DEBUG("Lock for mutex handle " << iter->native_handle << " was reactivated on file " << mFilename << " at line " << mLineNumber << ".");
294
                }
295
                }
295
 
296
 
296
                return true;
297
                return true;
297
            }
298
            }
298
        }
299
        }
Line 300... Line 301...
300
 
301
 
301
    _locks.push_back(lc);
302
    _locks.push_back(lc);
302
 
303
 
303
    if (mFilename.empty())
304
    if (mFilename.empty())
304
    {
305
    {
305
        MSG_PROTOCOL("Lock for mutex handle " << lc.native_handle << " was added.");
306
        MSG_DEBUG("Lock for mutex handle " << lc.native_handle << " was added.");
306
    }
307
    }
307
    else
308
    else
308
    {
309
    {
309
        MSG_PROTOCOL("Lock for mutex handle " << lc.native_handle << " was added on file " << mFilename << " at line " << mLineNumber << ".");
310
        MSG_DEBUG("Lock for mutex handle " << lc.native_handle << " was added on file " << mFilename << " at line " << mLineNumber << ".");
310
    }
311
    }
311
 
312
 
312
    if (death)
313
    if (death)
313
        *death = lc.noDeathLock;
314
        *death = lc.noDeathLock;
314
 
315
 
Line 347... Line 348...
347
    {
348
    {
348
        if (iter->native_handle == nhandle)
349
        if (iter->native_handle == nhandle)
349
        {
350
        {
350
            if (mFilename.empty())
351
            if (mFilename.empty())
351
            {
352
            {
352
                MSG_PROTOCOL("Lock for mutex handle " << iter->native_handle << " will be removed.");
353
                MSG_DEBUG("Lock for mutex handle " << iter->native_handle << " will be removed.");
353
            }
354
            }
354
            else
355
            else
355
            {
356
            {
356
                MSG_PROTOCOL("Lock for mutex handle " << iter->native_handle << " will be removed on file " << mFilename << " at line " << mLineNumber << ".");
357
                MSG_DEBUG("Lock for mutex handle " << iter->native_handle << " will be removed on file " << mFilename << " at line " << mLineNumber << ".");
357
            }
358
            }
358
 
359
 
359
            bool ret = iter->state;
360
            bool ret = iter->state;
360
            _locks.erase(iter);
361
            _locks.erase(iter);
361
            return ret;
362
            return ret;