Seg3D
2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
Main Page
Namespaces
Classes
Files
File List
Core
ITKCommon
ThreadUtils
the_mutex_interface.hxx
1
/*
2
For more information, please see: http://software.sci.utah.edu
3
4
The MIT License
5
6
Copyright (c) 2016 Scientific Computing and Imaging Institute,
7
University of Utah.
8
9
10
Permission is hereby granted, free of charge, to any person obtaining a
11
copy of this software and associated documentation files (the "Software"),
12
to deal in the Software without restriction, including without limitation
13
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
and/or sell copies of the Software, and to permit persons to whom the
15
Software is furnished to do so, subject to the following conditions:
16
17
The above copyright notice and this permission notice shall be included
18
in all copies or substantial portions of the Software.
19
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
DEALINGS IN THE SOFTWARE.
27
*/
28
29
// File : the_mutex_interface.hxx
30
// Author : Pavel A. Koshevoy
31
// Created : Sun Feb 18 16:12:00 MST 2007
32
// Copyright : (C) 2004-2008 University of Utah
33
// Description : An abstract mutex class interface.
34
35
#ifndef THE_MUTEX_INTERFACE_HXX_
36
#define THE_MUTEX_INTERFACE_HXX_
37
38
39
//----------------------------------------------------------------
40
// the_mutex_interface_t
41
//
42
class
the_mutex_interface_t
43
{
44
protected
:
45
// the destructor is protected on purpose,
46
// see delete_this for details:
47
virtual
~
the_mutex_interface_t
();
48
49
public
:
50
// In order to avoid memory management problems with shared libraries,
51
// whoever provides this interface instance (via it's creator), has to
52
// provide a way to delete the instance as well. This will avoid
53
// issues with multiple-instances of C runtime libraries being
54
// used by the app and whatever libraries it links against that
55
// either use or provide this interface:
56
virtual
void
delete_this() = 0;
57
58
// mutex controls:
59
virtual
void
lock() = 0;
60
virtual
void
unlock() = 0;
61
virtual
bool
try_lock() = 0;
62
63
//----------------------------------------------------------------
64
// creator_t
65
//
66
typedef
the_mutex_interface_t
*(*creator_t)();
67
68
// specify a thread creation method:
69
static
void
set_creator(creator_t creator);
70
71
// create a new instance of a thread:
72
static
the_mutex_interface_t
* create();
73
74
protected
:
75
// an abstract mutex creator:
76
static
creator_t creator_;
77
};
78
79
80
#endif // THE_MUTEX_INTERFACE_HXX_
the_mutex_interface_t
Definition:
the_mutex_interface.hxx:42
Generated on Wed Jun 29 2016 22:41:22 for Seg3D by
1.8.10