startup_code Namespace Reference


Classes

class  library_wide_cleanup
class  program_wide_cleanup

Functions

static_memory_gremlin BASIS_EXTERN & HOOPLE_GLOBALS ()
 Holds onto objects that have been allocated in a program-wide scope.
bool BASIS_EXTERN program_is_dying ()
 true if the program is trying to exit.
mutex BASIS_EXTERN & __memory_gremlin_synchronizer ()
 Internally used synchronization--not for outsiders.
const istring BASIS_EXTERN & istring_empty_string ()
 externally stored version of istring::empty_string.
const byte_array BASIS_EXTERN & byte_array_empty_array ()
 externally stored version of byte_array::empty_array.
mutex BASIS_EXTERN & __uptime_synchronizer ()
 used by our low-level uptime methods to protect singleton variables.
mutex BASIS_EXTERN & __process_synchronizer ()
 used for synchronizing our records of child processes.
const char BASIS_EXTERN * EXCEPTION_INFO_FOR_SHUTTING_DOWN ()
 exception string thrown for usage errors.
const byte_arraybyte_array_empty_array ()
 externally stored version of byte_array::empty_array.
const istringistring_empty_string ()
 externally stored version of istring::empty_string.

Variables

const char * _EXCEPTION_INFO_FOR_SHUTTING_DOWN = "Function must return immediately because program is shutting down."


Function Documentation

mutex & startup_code::__memory_gremlin_synchronizer (  ) 

Internally used synchronization--not for outsiders.

This is a very low level, private function that should not be invoked by the average user of the libraries. it is critical that it not be mis- used because a deadlock could result if it is used improperly. it returns a statically allocated mutex that can be used for the proper synchronization of our memory allocation manager. this particular function must be invoked at least once from the main thread before any other threads have been spawned. this ensures that all threads are seeing the same lock. this mutex is NOT to be used for anything other than securing static object creations from race conditions.

Definition at line 289 of file startup_code.cpp.

References static_memory_gremlin::get(), HOOPLE_GLOBALS(), and static_memory_gremlin::put().

Referenced by startup_code::library_wide_cleanup::library_wide_cleanup().

mutex & startup_code::__process_synchronizer (  ) 

used for synchronizing our records of child processes.

Definition at line 305 of file startup_code.cpp.

References SAFE_STATIC_IMPLEMENTATION.

Referenced by portable::exiting_child_signal_handler(), and portable::launch_process().

mutex & startup_code::__uptime_synchronizer (  ) 

used by our low-level uptime methods to protect singleton variables.

Definition at line 302 of file startup_code.cpp.

References SAFE_STATIC_IMPLEMENTATION.

Referenced by portable::rolling_uptime(), and portable::system_uptime().

const byte_array& startup_code::byte_array_empty_array (  ) 

externally stored version of byte_array::empty_array.

Definition at line 315 of file startup_code.cpp.

Referenced by byte_array::empty_array().

const byte_array BASIS_EXTERN& startup_code::byte_array_empty_array (  ) 

externally stored version of byte_array::empty_array.

Definition at line 315 of file startup_code.cpp.

Referenced by byte_array::empty_array().

const char BASIS_EXTERN * startup_code::EXCEPTION_INFO_FOR_SHUTTING_DOWN (  ) 

exception string thrown for usage errors.

this string will be thrown as an exception if a program is trying to use global objects when it should be shutting down instead.

Definition at line 60 of file startup_code.cpp.

References _EXCEPTION_INFO_FOR_SHUTTING_DOWN.

static_memory_gremlin & startup_code::HOOPLE_GLOBALS (  ) 

Holds onto objects that have been allocated in a program-wide scope.

These objects will have a lifetime up to the point of normal static object destruction and then they will be cleaned up.

Definition at line 183 of file startup_code.cpp.

References __argv, NIL, and program_wide_memories.

Referenced by __memory_gremlin_synchronizer(), and startup_code::program_wide_cleanup::~program_wide_cleanup().

const istring& startup_code::istring_empty_string (  ) 

externally stored version of istring::empty_string.

Definition at line 321 of file startup_code.cpp.

Referenced by istring::empty_string().

const istring BASIS_EXTERN& startup_code::istring_empty_string (  ) 

externally stored version of istring::empty_string.

Definition at line 321 of file startup_code.cpp.

Referenced by istring::empty_string().

bool BASIS_EXTERN startup_code::program_is_dying (  ) 

true if the program is trying to exit.

If this flag is true, then code should generally just return without doing anything where possible. It's especially important for long running loops or active threads to stop if they see this, although the normal program exit processes usually make it unnecessary.

Definition at line 58 of file startup_code.cpp.

Referenced by static_memory_gremlin::~static_memory_gremlin().


Variable Documentation

const char* startup_code::_EXCEPTION_INFO_FOR_SHUTTING_DOWN = "Function must return immediately because program is shutting down."

Definition at line 53 of file startup_code.cpp.

Referenced by EXCEPTION_INFO_FOR_SHUTTING_DOWN().


Generated on Mon Jan 14 04:32:38 2008 for HOOPLE Libraries by  doxygen 1.5.1