Commit 17ab5875 authored by Alexandre Julliard's avatar Alexandre Julliard

loader: Use a hidden function instead of an exported global variable to setup pthread functions.

parent 912e4d4d
......@@ -324,7 +324,7 @@ static void DECLSPEC_NORETURN abort_thread( long status )
/***********************************************************************
* pthread_functions
*/
const struct wine_pthread_functions pthread_functions =
static const struct wine_pthread_functions pthread_functions =
{
init_process,
init_thread,
......@@ -336,6 +336,10 @@ const struct wine_pthread_functions pthread_functions =
sigprocmask
};
void init_pthread_functions(void)
{
wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) );
}
/* Currently this probably works only for glibc2,
* which checks for the presence of double-underscore-prepended
......
......@@ -106,7 +106,7 @@ int main( int argc, char *argv[] )
reserve_area( wine_main_preload_info[i].addr, wine_main_preload_info[i].size );
}
wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) );
init_pthread_functions();
wine_init( argc, argv, error, sizeof(error) );
fprintf( stderr, "wine: failed to initialize: %s\n", error );
exit(1);
......
......@@ -30,6 +30,10 @@ struct wine_preload_info
size_t size;
};
extern const struct wine_pthread_functions pthread_functions;
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
extern void init_pthread_functions(void) __attribute__((visibility ("hidden")));
#else
extern void init_pthread_functions(void);
#endif
#endif /* __WINE_LOADER_MAIN_H */
......@@ -246,7 +246,7 @@ static int pthread_sigmask( int how, const sigset_t *newset, sigset_t *oldset )
/***********************************************************************
* pthread_functions
*/
const struct wine_pthread_functions pthread_functions =
static const struct wine_pthread_functions pthread_functions =
{
init_process,
init_thread,
......@@ -257,3 +257,8 @@ const struct wine_pthread_functions pthread_functions =
abort_thread,
pthread_sigmask
};
void init_pthread_functions(void)
{
wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment