tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
lib_globals.hpp
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2011
3  * University of Rochester Department of Computer Science
4  * and
5  * Lehigh University Department of Computer Science and Engineering
6  *
7  * License: Modified BSD
8  * Please see the file LICENSE.RSTM for licensing information
9  */
10 
11 #ifndef LIB_GLOBALS_HPP
12 #define LIB_GLOBALS_HPP
13 
14 /**
15  * In this file, we declare functions and variables that need to be visible
16  * to many parts of the STM library, but that do not need to be visible to
17  * application code.
18  */
19 
20 #include <stm/config.h>
21 #include <stm/metadata.hpp>
22 
23 namespace stm
24 {
25  struct TxThread;
26  typedef void (*AbortHandler)(TxThread*);
27  void sys_init(AbortHandler conflict_abort);
28  void set_policy(const char* phasename);
29  void sys_shutdown();
30  bool is_irrevoc(const TxThread&);
31 #ifdef STM_PROTECT_STACK
32  void become_irrevoc(void** upper_stack_bound);
33 #else
34  void become_irrevoc();
35 #endif
36  void restart();
37  const char* get_algname();
38 
39  extern pad_word_t threadcount; // threads in system
40  extern TxThread* threads[MAX_THREADS]; // all TxThreads
41 }
42 
43 #endif // LIB_GLOBALS_HPP
TxThread * threads[MAX_THREADS]
Definition: txthread.cpp:56
Definition: metadata.hpp:115
Definition: stm_fraser.c:61
bool is_irrevoc(const TxThread &)
Definition: irrevocability.cpp:194
pad_word_t threadcount
Definition: WBMMPolicy.hpp:35
void sys_init(void(*abort_handler)(TxThread *)=NULL)
void(* AbortHandler)(TxThread *)
Definition: lib_globals.hpp:26
void sys_shutdown()
Definition: txthread.cpp:203
bool become_irrevoc(STM_WHEN_PROTECT_STACK(void **top_of_stack))
Definition: txthread.hpp:47
static const unsigned MAX_THREADS
Definition: metadata.hpp:33
const char * get_algname()
Definition: txthread.cpp:386
void set_policy(const char *)
Definition: txthread.cpp:261
void restart()
Definition: txthread.cpp:189