mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Refine init of global objects
This commit is contained in:
parent
8b58d18a5a
commit
4cf6da107c
2 changed files with 12 additions and 3 deletions
|
@ -37,6 +37,10 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
extern ISrsLog* _srs_log;
|
||||||
|
extern ISrsContext* _srs_context;
|
||||||
|
extern SrsConfig* _srs_config;
|
||||||
|
|
||||||
extern SrsStageManager* _srs_stages;
|
extern SrsStageManager* _srs_stages;
|
||||||
extern SrsRtcBlackhole* _srs_blackhole;
|
extern SrsRtcBlackhole* _srs_blackhole;
|
||||||
extern SrsResourceManager* _srs_rtc_manager;
|
extern SrsResourceManager* _srs_rtc_manager;
|
||||||
|
@ -275,6 +279,11 @@ srs_error_t srs_thread_initialize()
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
// Root global objects.
|
||||||
|
_srs_log = new SrsFileLog();
|
||||||
|
_srs_context = new SrsThreadContext();
|
||||||
|
_srs_config = new SrsConfig();
|
||||||
|
|
||||||
// The clock wall object.
|
// The clock wall object.
|
||||||
_srs_clock = new SrsWallClock();
|
_srs_clock = new SrsWallClock();
|
||||||
|
|
||||||
|
|
|
@ -70,10 +70,10 @@ srs_error_t run_hybrid_server();
|
||||||
void show_macro_features();
|
void show_macro_features();
|
||||||
|
|
||||||
// @global log and context.
|
// @global log and context.
|
||||||
ISrsLog* _srs_log = new SrsFileLog();
|
ISrsLog* _srs_log = NULL;
|
||||||
ISrsContext* _srs_context = new SrsThreadContext();
|
ISrsContext* _srs_context = NULL;
|
||||||
// @global config object for app module.
|
// @global config object for app module.
|
||||||
SrsConfig* _srs_config = new SrsConfig();
|
SrsConfig* _srs_config = NULL;
|
||||||
|
|
||||||
// @global version of srs, which can grep keyword "XCORE"
|
// @global version of srs, which can grep keyword "XCORE"
|
||||||
extern const char* _srs_version;
|
extern const char* _srs_version;
|
||||||
|
|
Loading…
Reference in a new issue