11//Provides: caml_domain_dls
2+ //Version: >= 5
23var caml_domain_dls = [ 0 ] ;
34
45//Provides: caml_domain_dls_set
56//Requires: caml_domain_dls
7+ //Version: >= 5
68function caml_domain_dls_set ( a ) {
79 caml_domain_dls = a ;
810}
@@ -18,16 +20,19 @@ function caml_domain_dls_compare_and_set(old, n) {
1820
1921//Provides: caml_domain_dls_get
2022//Requires: caml_domain_dls
23+ //Version: >= 5
2124function caml_domain_dls_get ( unit ) {
2225 return caml_domain_dls ;
2326}
2427
2528//Provides: caml_atomic_load
29+ //Version: >= 5
2630function caml_atomic_load ( ref ) {
2731 return ref [ 1 ] ;
2832}
2933
3034//Provides: caml_atomic_cas
35+ //Version: >= 5
3136function caml_atomic_cas ( ref , o , n ) {
3237 if ( ref [ 1 ] === o ) {
3338 ref [ 1 ] = n ;
@@ -37,13 +42,15 @@ function caml_atomic_cas(ref, o, n) {
3742}
3843
3944//Provides: caml_atomic_fetch_add
45+ //Version: >= 5
4046function caml_atomic_fetch_add ( ref , i ) {
4147 var old = ref [ 1 ] ;
4248 ref [ 1 ] += i ;
4349 return old ;
4450}
4551
4652//Provides: caml_atomic_exchange
53+ //Version: >= 5
4754function caml_atomic_exchange ( ref , v ) {
4855 var r = ref [ 1 ] ;
4956 ref [ 1 ] = v ;
@@ -57,18 +64,14 @@ function caml_atomic_make_contended(a) {
5764}
5865
5966//Provides: caml_ml_domain_unique_token
60- //Version: < 5.2
67+ //Version: >= 5.0, < 5.2
6168var caml_ml_domain_unique_token_ = [ 0 ] ;
6269function caml_ml_domain_unique_token ( unit ) {
6370 return caml_ml_domain_unique_token_ ;
6471}
6572
66- //Provides: caml_ml_domain_set_name
67- function caml_ml_domain_set_name ( _name ) {
68- return 0 ;
69- }
70-
7173//Provides: caml_recommended_domain_count
74+ //Version: >= 5
7275function caml_recommended_domain_count ( unit ) {
7376 return 1 ;
7477}
@@ -81,6 +84,7 @@ function caml_ml_domain_index(unit) {
8184}
8285
8386//Provides: caml_domain_id
87+ //Version: >= 5
8488var caml_domain_id = 0 ;
8589
8690//Provides: caml_domain_spawn
@@ -105,7 +109,7 @@ function caml_domain_spawn(f, term_sync) {
105109//Requires: caml_ml_mutex_unlock
106110//Requires: caml_domain_id
107111//Requires: caml_callback
108- //Version: < 5.2
112+ //Version: >= 5.0, < 5.2
109113var caml_domain_latest_idx = 1 ;
110114function caml_domain_spawn ( f , mutex ) {
111115 var id = caml_domain_latest_idx ++ ;
@@ -119,11 +123,13 @@ function caml_domain_spawn(f, mutex) {
119123
120124//Provides: caml_ml_domain_id
121125//Requires: caml_domain_id
126+ //Version: >= 5.0
122127function caml_ml_domain_id ( unit ) {
123128 return caml_domain_id ;
124129}
125130
126131//Provides: caml_ml_domain_cpu_relax
132+ //Version: >= 5
127133function caml_ml_domain_cpu_relax ( unit ) {
128134 return 0 ;
129135}
0 commit comments