/* Copyright 2005 Chris Thomasson */


#include "../ac_thread.h"




#ifndef AC_SYS_THREAD_H
#define AC_SYS_THREAD_H


#ifdef __cplusplus
extern "C"
{
#endif




#ifdef _MSC_VER 
/* 4324: structure was padded due to _declspec(align()) */
#pragma warning ( disable : 4324 )
#endif


typedef struct 
AC_DECLSPEC_ALIGN_CACHE_LINE
ac_sys_thread_this_
{
  ac_cpu_stack_mpmc_t node_cache;
  ac_intword_t tls_count;
  ac_intword_t node_count;
  ac_uintword_t thread_ids;

} ac_sys_thread_this_t;


#ifdef _MSC_VER 
/* 4324: structure was padded due to _declspec(align()) */
#pragma warning ( default : 4324 )
#endif




AC_SYS_APIEXPORT int AC_APIDECL
ac_sys_thread_startup
( ac_sys_thread_this_t* );


AC_SYS_APIEXPORT void AC_APIDECL
ac_sys_thread_tls_shutdown
( void );


AC_SYS_APIEXPORT void AC_APIDECL
ac_sys_thread_cache_flush
( void );


AC_SYS_APIEXPORT int AC_APIDECL
ac_sys_thread_shutdown
( void );


AC_SYS_APIEXPORT int AC_APIDECL
ac_sys_thread_release
( ac_thread_t* );




#ifdef __cplusplus
}
#endif


#endif