1 /*
2    BAREOS® - Backup Archiving REcovery Open Sourced
3 
4    Copyright (C) 2008-2011 Free Software Foundation Europe e.V.
5    Copyright (C) 2013-2020 Bareos GmbH & Co. KG
6 
7    This program is Free Software; you can redistribute it and/or
8    modify it under the terms of version three of the GNU Affero General Public
9    License as published by the Free Software Foundation and included
10    in the file LICENSE.
11 
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15    Affero General Public License for more details.
16 
17    You should have received a copy of the GNU Affero General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301, USA.
21 */
22 
23 #include "include/bareos.h"
24 #include "lib/berrno.h"
25 
Lmgr_p(pthread_mutex_t * m)26 void Lmgr_p(pthread_mutex_t* m)
27 {
28   int errstat;
29   if ((errstat = pthread_mutex_lock(m))) {
30     BErrNo be;
31     e_msg(__FILE__, __LINE__, M_ABORT, 0, _("Mutex lock failure. ERR=%s\n"),
32           be.bstrerror(errstat));
33   }
34 }
35 
Lmgr_v(pthread_mutex_t * m)36 void Lmgr_v(pthread_mutex_t* m)
37 {
38   int errstat;
39   if ((errstat = pthread_mutex_unlock(m))) {
40     BErrNo be;
41     e_msg(__FILE__, __LINE__, M_ABORT, 0, _("Mutex unlock failure. ERR=%s\n"),
42           be.bstrerror(errstat));
43   }
44 }
45