Skip to content

Commit

Permalink
tmp: test a sync
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Sep 28, 2023
1 parent fb96dfe commit 4bd1381
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions c_src/quicer_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ limitations under the License.
#include <openssl/x509.h>

extern QuicerRegistrationCTX *G_r_ctx;
extern pthread_mutex_t GRegLock;

BOOLEAN parse_registration(ErlNifEnv *env,
ERL_NIF_TERM options,
Expand Down Expand Up @@ -334,12 +335,15 @@ listen2(ErlNifEnv *env, __unused_parm__ int argc, const ERL_NIF_TERM argv[])

// quic_registration is not set, use global registration
// msquic should reject if global registration is NULL (closed)
pthread_mutex_lock(&GRegLock);
if (G_r_ctx)
{
Registration = G_r_ctx->Registration;
pthread_mutex_unlock(&GRegLock);
}
else
{
pthread_mutex_unlock(&GRegLock);
ret = ERROR_TUPLE_2(ATOM_QUIC_REGISTRATION);
goto exit;
}
Expand Down
1 change: 0 additions & 1 deletion test/quicer_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ tc_open_listener_inval_reg(Config) ->
quicer:reg_open(),
ok.


tc_stream_client_init(Config) ->
Port = select_port(),
Owner = self(),
Expand Down

0 comments on commit 4bd1381

Please sign in to comment.