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.
the_thread_storage.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_thread_storage.hxx
30 // Author : Pavel A. Koshevoy
31 // Created : Fri Jan 2 09:30:00 MDT 2007
32 // Copyright : (C) 2004-2008 University of Utah
33 // Description : A thread storage abstract interface class.
34 
35 #ifndef THE_THREAD_STORAGE_HXX_
36 #define THE_THREAD_STORAGE_HXX_
37 
38 // forward declarations:
40 class the_terminators_t;
41 
42 //----------------------------------------------------------------
43 // the_thread_observer_t
44 //
46 {
47 public:
49  thread_(thread)
50  {}
51 
52  the_thread_interface_t & thread_;
53 };
54 
55 //----------------------------------------------------------------
56 // the_thread_storage_t
57 //
59 {
60 public:
61  virtual ~the_thread_storage_t() {}
62 
63  // check whether the thread storage has been initialized:
64  virtual bool is_ready() const = 0;
65 
66  // check whether the thread has been stopped:
67  virtual bool thread_stopped() const = 0;
68 
69  // terminator access:
70  virtual the_terminators_t & terminators() = 0;
71 
72  // thread id:
73  virtual unsigned int thread_id() const = 0;
74 };
75 
76 //----------------------------------------------------------------
77 // the_thread_storage_provider_t
78 //
79 typedef the_thread_storage_t&(*the_thread_storage_provider_t)();
80 
81 //----------------------------------------------------------------
82 // set_the_thread_storage_provider
83 //
84 // Set the new thread storage provider, return the old provider.
85 //
86 extern the_thread_storage_provider_t
87 set_the_thread_storage_provider(the_thread_storage_provider_t p);
88 
89 //----------------------------------------------------------------
90 // the_thread_storage
91 //
92 // Thread storage accessors.
93 //
94 extern the_thread_storage_t & the_thread_storage();
95 
96 
97 #endif // THE_THREAD_STORAGE_HXX_
Definition: the_thread_storage.hxx:45
Definition: the_thread_storage.hxx:58
Definition: the_terminator.hxx:120
Definition: the_thread_interface.hxx:57