Skip to content

Commit

Permalink
add SW_THREAD_LOCAL (#5619)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFreeman authored Dec 15, 2024
1 parent b3c61e1 commit 6700e99
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext-src/swoole_odbc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#ifdef SW_USE_ODBC

static bool swoole_odbc_blocking = true;
static SW_THREAD_LOCAL bool swoole_odbc_blocking = true;

#ifdef SQL_ATTR_CONNECTION_POOLING
zend_ulong pdo_odbc_pool_on = SQL_CP_OFF;
Expand Down
2 changes: 1 addition & 1 deletion ext-src/swoole_oracle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#ifdef SW_USE_ORACLE

static bool swoole_oracle_blocking = true;
static SW_THREAD_LOCAL bool swoole_oracle_blocking = true;
void swoole_oracle_set_blocking(bool blocking) {
swoole_oracle_blocking = blocking;
}
Expand Down
2 changes: 1 addition & 1 deletion ext-src/swoole_pgsql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using swoole::Coroutine;
using swoole::coroutine::Socket;
using swoole::coroutine::translate_events_to_poll;

static bool swoole_pgsql_blocking = true;
static SW_THREAD_LOCAL bool swoole_pgsql_blocking = true;

static int swoole_pgsql_socket_poll(PGconn *conn, swEventType event, double timeout = -1) {
if (swoole_pgsql_blocking) {
Expand Down
2 changes: 1 addition & 1 deletion ext-src/swoole_sqlite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifdef SW_USE_SQLITE
using swoole::Coroutine;

static bool swoole_sqlite_blocking = true;
static SW_THREAD_LOCAL bool swoole_sqlite_blocking = true;

void swoole_sqlite_set_blocking(bool blocking) {
if (blocking) {
Expand Down

0 comments on commit 6700e99

Please sign in to comment.