OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Mutex.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2023 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #pragma once
22 
23 #include "ocilibcpp/types.hpp"
24 
25 namespace ocilib
26 {
27 
29 {
30  return Environment::GetInstance().Initialized() ? core::Check(OCI_MutexCreate()) : nullptr;
31 }
32 
33 inline void Mutex::Destroy(MutexHandle handle)
34 {
35  core::Check(OCI_MutexFree(handle));
36 }
37 
38 inline void Mutex::Acquire(MutexHandle handle)
39 {
41 }
42 
43 inline void Mutex::Release(MutexHandle handle)
44 {
46 }
47 
48 }
static void Destroy(MutexHandle handle)
Destroy a mutex handle.
Definition: Mutex.hpp:33
static void Release(MutexHandle handle)
Release a mutex lock.
Definition: Mutex.hpp:43
static MutexHandle Create()
Create a Mutex handle.
Definition: Mutex.hpp:28
static void Acquire(MutexHandle handle)
Acquire a mutex lock.
Definition: Mutex.hpp:38
OCI_SYM_PUBLIC OCI_Mutex *OCI_API OCI_MutexCreate(void)
Create a Mutex object.
OCI_SYM_PUBLIC boolean OCI_API OCI_MutexFree(OCI_Mutex *mutex)
Destroy a mutex object.
OCI_SYM_PUBLIC boolean OCI_API OCI_MutexRelease(OCI_Mutex *mutex)
Release a mutex lock.
OCI_SYM_PUBLIC boolean OCI_API OCI_MutexAcquire(OCI_Mutex *mutex)
Acquire a mutex lock.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
Definition: Utils.hpp:53
OCILIB ++ Namespace.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: config.hpp:147