@@ -1672,8 +1672,6 @@ include Pending_promises
16721672
16731673
16741674let tracing_context = new_key ()
1675- let tracing_counter = ref 0
1676- let tracing_counter () = incr tracing_counter; ! tracing_counter
16771675
16781676module Sequential_composition :
16791677sig
@@ -1908,7 +1906,6 @@ struct
19081906
19091907 let backtrace_bind loc_f loc_l add_loc p f =
19101908 let trace_context = Sequence_associated_storage. get tracing_context in
1911- let trace_counter = tracing_counter () in
19121909 let Internal p = to_internal_promise p in
19131910 let p = underlying p in
19141911
@@ -1918,7 +1915,7 @@ struct
19181915 let saved_storage = ! current_storage in
19191916
19201917 let callback p_result =
1921- if trace then Lwt_rte. emit_trace End trace_context trace_counter loc_f loc_l;
1918+ if trace then Lwt_rte. emit_trace End trace_context loc_f loc_l;
19221919 match p_result with
19231920 | Fulfilled v ->
19241921 current_storage := saved_storage;
@@ -1962,7 +1959,7 @@ struct
19621959 to_public_promise {state = Rejected (add_loc exn )}
19631960
19641961 | Pending p_callbacks ->
1965- Lwt_rte. emit_trace Begin trace_context trace_counter loc_f loc_l;
1962+ Lwt_rte. emit_trace Begin trace_context loc_f loc_l;
19661963 let (p'', callback) = create_result_promise_and_callback_if_deferred true () in
19671964 add_implicitly_removed_callback p_callbacks callback;
19681965 p''
@@ -2092,7 +2089,6 @@ struct
20922089
20932090 let backtrace_catch loc_f loc_l add_loc f h =
20942091 let trace_context = Sequence_associated_storage. get tracing_context in
2095- let trace_counter = tracing_counter () in
20962092 let p =
20972093 try f ()
20982094 with exn when Exception_filter. run exn -> fail exn
@@ -2106,7 +2102,7 @@ struct
21062102 let saved_storage = ! current_storage in
21072103
21082104 let callback p_result =
2109- if traced then Lwt_rte. emit_trace End trace_context trace_counter loc_f loc_l;
2105+ if traced then Lwt_rte. emit_trace End trace_context loc_f loc_l;
21102106 match p_result with
21112107 | Fulfilled _ as p_result ->
21122108 let State_may_now_be_pending_proxy p'' = may_now_be_proxy p'' in
@@ -2151,7 +2147,7 @@ struct
21512147 (p'', callback, p.state))
21522148
21532149 | Pending p_callbacks ->
2154- Lwt_rte. emit_trace Begin trace_context trace_counter loc_f loc_l;
2150+ Lwt_rte. emit_trace Begin trace_context loc_f loc_l;
21552151 let (p'', callback) = create_result_promise_and_callback_if_deferred true () in
21562152 add_implicitly_removed_callback p_callbacks callback;
21572153 p''
@@ -2233,7 +2229,6 @@ struct
22332229
22342230 let backtrace_try_bind loc_f loc_l add_loc f f' h =
22352231 let trace_context = Sequence_associated_storage. get tracing_context in
2236- let trace_counter = tracing_counter () in
22372232 let p =
22382233 try f ()
22392234 with exn when Exception_filter. run exn -> fail exn
@@ -2247,7 +2242,7 @@ struct
22472242 let saved_storage = ! current_storage in
22482243
22492244 let callback p_result =
2250- if traced then Lwt_rte. emit_trace End trace_context trace_counter loc_f loc_l;
2245+ if traced then Lwt_rte. emit_trace End trace_context loc_f loc_l;
22512246 match p_result with
22522247 | Fulfilled v ->
22532248 current_storage := saved_storage;
@@ -2307,7 +2302,7 @@ struct
23072302 (p'', callback, p.state))
23082303
23092304 | Pending p_callbacks ->
2310- Lwt_rte. emit_trace Begin trace_context trace_counter loc_f loc_l;
2305+ Lwt_rte. emit_trace Begin trace_context loc_f loc_l;
23112306 let (p'', callback) = create_result_promise_and_callback_if_deferred true () in
23122307 add_implicitly_removed_callback p_callbacks callback;
23132308 p''
0 commit comments