1 #ifndef _SYS_SERIALIZE2_H_
2 #define _SYS_SERIALIZE2_H_
5 #error "kernel only header file"
13 #include <sys/systm.h>
16 #ifndef _SYS_SERIALIZE_H_
17 #include <sys/serialize.h>
21 lwkt_serialize_array_enter(lwkt_serialize_t *_arr, int _arrcnt, int _s)
23 KASSERT(_s < _arrcnt, ("nothing to be serialized\n"));
25 lwkt_serialize_enter(_arr[_s++]);
29 lwkt_serialize_array_try(lwkt_serialize_t *_arr, int _arrcnt, int _s)
33 KASSERT(_s < _arrcnt, ("nothing to be serialized\n"));
34 for (_i = _s; _i < _arrcnt; ++_i) {
35 if (!lwkt_serialize_try(_arr[_i])) {
37 lwkt_serialize_exit(_arr[_i]);
45 lwkt_serialize_array_exit(lwkt_serialize_t *_arr, int _arrcnt, int _s)
47 KASSERT(_arrcnt > _s, ("nothing to be deserialized\n"));
48 while (--_arrcnt >= _s)
49 lwkt_serialize_exit(_arr[_arrcnt]);
52 #endif /* !_SYS_SERIALIZE2_H_ */