Version: 9.15.0
SALOME_LockServantImpl.hxx
Go to the documentation of this file.
1 // Copyright (C) 2024-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #pragma once
21 
22 #include "SALOME_Container.hxx"
23 
24 #include <SALOMEconfig.h>
25 
26 #include CORBA_SERVER_HEADER(SALOME_Locker)
27 
28 #include <mutex>
29 #include <future>
30 #include <vector>
31 
32 namespace SALOME
33 {
34  class CONTAINER_EXPORT LockServantImpl : public virtual POA_Engines::LockServant
35  {
36  public:
37  LockServantImpl() = default;
38  void acquire() override;
39  void release() override;
40  private:
41  std::mutex _mutex;
42  };
43 
44  class CONTAINER_EXPORT RendezVousServantImpl : public virtual POA_Engines::RendezVousServant
45  {
46  public:
47  RendezVousServantImpl(unsigned int nbOfClientsToWait);
48  void acquire() override;
49  private:
50  std::vector< std::promise<void> > _promise;
51  std::mutex _mutex;
52  unsigned int _nb_clients;
53  };
54 }
#define CONTAINER_EXPORT
Definition: SALOME_Container.hxx:37
Definition: SALOME_LockServantImpl.hxx:35
std::mutex _mutex
Definition: SALOME_LockServantImpl.hxx:41
Definition: SALOME_LockServantImpl.hxx:45
std::vector< std::promise< void > > _promise
Definition: SALOME_LockServantImpl.hxx:50
std::mutex _mutex
Definition: SALOME_LockServantImpl.hxx:51
unsigned int _nb_clients
Definition: SALOME_LockServantImpl.hxx:52
Module SALOME contains all base interfaces of SALOME Kernel.
Definition: SALOME_LockMasterImpl.hxx:29