@@ -942,25 +942,39 @@ int thingset_bin_process(struct thingset_context *ts)
942
942
/* requests ordered with expected highest probability first */
943
943
switch (ts -> msg [0 ]) {
944
944
case THINGSET_BIN_GET :
945
+ thingset_acquire_read_lock (ts -> context , K_FOREVER );
945
946
ret = thingset_common_get (ts );
947
+ thingset_release_read_lock (ts -> context );
946
948
break ;
947
949
case THINGSET_BIN_FETCH :
950
+ thingset_acquire_read_lock (ts -> context , K_FOREVER );
948
951
ret = thingset_common_fetch (ts );
952
+ thingset_release_read_lock (ts -> context );
949
953
break ;
950
954
case THINGSET_BIN_UPDATE :
955
+ thingset_acquire_write_lock (ts -> context , K_FOREVER );
951
956
ret = thingset_common_update (ts );
957
+ thingset_release_write_lock (ts -> context );
952
958
break ;
953
959
case THINGSET_BIN_EXEC :
960
+ thingset_acquire_write_lock (ts -> context , K_FOREVER );
954
961
ret = thingset_common_exec (ts );
962
+ thingset_release_write_lock (ts -> context );
955
963
break ;
956
964
case THINGSET_BIN_CREATE :
965
+ thingset_acquire_write_lock (ts -> context , K_FOREVER );
957
966
ret = thingset_common_create (ts );
967
+ thingset_release_write_lock (ts -> context );
958
968
break ;
959
969
case THINGSET_BIN_DELETE :
970
+ thingset_acquire_write_lock (ts -> context , K_FOREVER );
960
971
ret = thingset_common_delete (ts );
972
+ thingset_release_write_lock (ts -> context );
961
973
break ;
962
974
case THINGSET_BIN_DESIRE :
975
+ thingset_acquire_read_lock (ts -> context , K_FOREVER );
963
976
ret = thingset_bin_desire (ts );
977
+ thingset_release_read_lock (ts -> context );
964
978
break ;
965
979
default :
966
980
return - THINGSET_ERR_BAD_REQUEST ;
0 commit comments