mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 09:23:03 +01:00
Some thread safety
This commit is contained in:
parent
e58d227427
commit
a93f6c32f0
@ -7024,11 +7024,11 @@ ISC_STATUS FB_CANCEL_OPERATION(ISC_STATUS* user_status, Rdb** db_handle, USHORT
|
|||||||
**************************************/
|
**************************************/
|
||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
RemPortPtr port(rdb->rdb_port);
|
||||||
|
|
||||||
if (kind == fb_cancel_abort)
|
if (kind == fb_cancel_abort)
|
||||||
{
|
{
|
||||||
rdb->rdb_port->force_close();
|
port->force_close();
|
||||||
|
|
||||||
user_status[0] = isc_arg_gds;
|
user_status[0] = isc_arg_gds;
|
||||||
user_status[1] = FB_SUCCESS;
|
user_status[1] = FB_SUCCESS;
|
||||||
|
@ -59,6 +59,7 @@ const char* EVENT_PIPE_SUFFIX = "event";
|
|||||||
Firebird::AtomicCounter event_counter;
|
Firebird::AtomicCounter event_counter;
|
||||||
|
|
||||||
static Firebird::GlobalPtr<PortsCleanup> wnet_ports;
|
static Firebird::GlobalPtr<PortsCleanup> wnet_ports;
|
||||||
|
static Firebird::GlobalPtr<Firebird::Mutex> init_mutex;
|
||||||
static bool wnet_initialized = false;
|
static bool wnet_initialized = false;
|
||||||
static bool wnet_shutdown = false;
|
static bool wnet_shutdown = false;
|
||||||
|
|
||||||
@ -564,8 +565,12 @@ static rem_port* alloc_port( rem_port* parent)
|
|||||||
|
|
||||||
if (!wnet_initialized)
|
if (!wnet_initialized)
|
||||||
{
|
{
|
||||||
wnet_initialized = true;
|
Firebird::MutexLockGuard guard(init_mutex);
|
||||||
fb_shutdown_callback(0, cleanup_ports, fb_shut_postproviders, 0);
|
if (!wnet_initialized)
|
||||||
|
{
|
||||||
|
wnet_initialized = true;
|
||||||
|
fb_shutdown_callback(0, cleanup_ports, fb_shut_postproviders, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rem_port* port = new rem_port(rem_port::PIPE, BUFFER_SIZE * 2);
|
rem_port* port = new rem_port(rem_port::PIPE, BUFFER_SIZE * 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user