@@ -1101,10 +1101,21 @@ CAMLprim value PQgetResult_stub(value v_conn)
11011101}
11021102
11031103noalloc_conn_info_intnat (PQconsumeInput )
1104- noalloc_conn_info ( PQisBusy , Val_bool )
1104+
11051105noalloc_conn_info_intnat (PQflush )
11061106noalloc_conn_info_intnat (PQsocket )
11071107
1108+ CAMLprim value PQisBusy_stub (value v_conn )
1109+ {
1110+ CAMLparam1 (v_conn );
1111+ PGconn * conn = get_conn (v_conn );
1112+ bool res ;
1113+ caml_enter_blocking_section ();
1114+ res = PQisBusy (conn );
1115+ caml_leave_blocking_section ();
1116+ CAMLreturn (Val_bool (res ));
1117+ }
1118+
11081119CAMLprim value PQCancel_stub (value v_conn )
11091120{
11101121 CAMLparam1 (v_conn );
@@ -1392,9 +1403,9 @@ CAMLprim value PQendcopy_stub_bc(value v_conn)
13921403static inline void notice_ml (void * cb , const char * msg )
13931404{
13941405 value v_msg ;
1395- /* CR mmottl for mmottl: this is not reliable and can lead to segfaults,
1396- because the runtime lock may already be held (but not usually).
1397- A runtime feature is needed to fully support this. */
1406+ /* CR mmottl for mmottl: this is not reliable and can lead to deadlocks or
1407+ other unintended behavior, because the runtime lock may already be held
1408+ (but not usually). A runtime feature is needed to fully support this. */
13981409 caml_leave_blocking_section ();
13991410 v_msg = make_string (msg );
14001411 caml_callback (((np_callback * ) cb )-> v_cb , v_msg );
0 commit comments