XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
Seqlock.cxx
浏览该文件的文档.
1
14
15namespace xwos {
16namespace lock {
17
18/* Seqlock::RdexLkGrd Non-static Member */
20 : mSeqlock(seqlock)
21 , mStatus(Seqlock::LockStatus::SeqlockUnlocked)
22{
23 if (nullptr != mSeqlock) {
26 }
27}
28
30 : mSeqlock(&seqlock)
32{
33 if (nullptr != mSeqlock) {
36 }
37}
38
40{
41 if (nullptr != mSeqlock) {
44 xwos_sqlk_rdex_unlock(&mSeqlock->mLock);
45 }
46 }
47}
48
50{
51 xwer_t rc;
52 if (nullptr != mSeqlock) {
54 union xwos_ulock lock;
55 xwsq_t lkst;
56 lock.osal.sqlk = &mSeqlock->mLock;
57 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
58 &lkst);
59 if (rc < 0) {
60 if (XWOS_LKST_UNLOCKED == lkst) {
61 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
62 }
63 }
64 } else {
65 rc = -ENOLCK;
66 }
67 } else {
68 rc = -EFAULT;
69 }
70 return rc;
71}
72
74{
75 xwer_t rc;
76 if (nullptr != mSeqlock) {
78 union xwos_ulock lock;
79 xwsq_t lkst;
80 lock.osal.sqlk = &mSeqlock->mLock;
81 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
82 to, &lkst);
83 if (rc < 0) {
84 if (XWOS_LKST_UNLOCKED == lkst) {
85 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
86 }
87 }
88 } else {
89 rc = -ENOLCK;
90 }
91 } else {
92 rc = -EFAULT;
93 }
94 return rc;
95}
96
97/* Seqlock::TryRdexLkGrd Non-static Member */
99 : RdexLkGrd()
100{
101 mSeqlock = seqlock;
102 if (nullptr != mSeqlock) {
104 if (XWOK != mRc) {
105 mSeqlock = nullptr;
106 }
107 }
108}
109
111 : RdexLkGrd()
112{
113 mSeqlock = &seqlock;
114 if (nullptr != mSeqlock) {
116 if (XWOK != mRc) {
117 mSeqlock = nullptr;
118 }
119 }
120}
121
122/* Seqlock::RdexLkThGrd Non-static Member */
124 : mSeqlock(seqlock)
126{
127 if (nullptr != mSeqlock) {
130 }
131}
132
134 : mSeqlock(&seqlock)
136{
137 if (nullptr != mSeqlock) {
140 }
141}
142
144{
145 if (nullptr != mSeqlock) {
148 xwos_sqlk_rdex_unlock_cpuirqrs(&mSeqlock->mLock, mCpuirq);
149 }
150 }
151}
152
154{
155 xwer_t rc;
156 if (nullptr != mSeqlock) {
158 union xwos_ulock lock;
159 xwsq_t lkst;
160 lock.osal.sqlk = &mSeqlock->mLock;
161 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
162 &lkst);
163 if (rc < 0) {
164 if (XWOS_LKST_UNLOCKED == lkst) {
165 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
166 }
167 }
168 } else {
169 rc = -ENOLCK;
170 }
171 } else {
172 rc = -EFAULT;
173 }
174 return rc;
175}
176
178{
179 xwer_t rc;
180 if (nullptr != mSeqlock) {
182 union xwos_ulock lock;
183 xwsq_t lkst;
184 lock.osal.sqlk = &mSeqlock->mLock;
185 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
186 to, &lkst);
187 if (rc < 0) {
188 if (XWOS_LKST_UNLOCKED == lkst) {
189 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
190 }
191 }
192 } else {
193 rc = -ENOLCK;
194 }
195 } else {
196 rc = -EFAULT;
197 }
198 return rc;
199}
200
201/* Seqlock::TryRdexLkThGrd Non-static Member */
203 : RdexLkThGrd()
204{
205 mSeqlock = seqlock;
206 if (nullptr != mSeqlock) {
208 if (XWOK != mRc) {
209 mSeqlock = nullptr;
210 }
211 }
212}
213
215 : RdexLkThGrd()
216{
217 mSeqlock = &seqlock;
218 if (nullptr != mSeqlock) {
220 if (XWOK != mRc) {
221 mSeqlock = nullptr;
222 }
223 }
224}
225
226/* Seqlock::RdexLkBhGrd Non-static Member */
228 : mSeqlock(seqlock)
230{
231 if (nullptr != mSeqlock) {
234 }
235}
236
238 : mSeqlock(&seqlock)
240{
241 if (nullptr != mSeqlock) {
244 }
245}
246
248{
249 if (nullptr != mSeqlock) {
252 xwos_sqlk_rdex_unlock_bh(&mSeqlock->mLock);
253 }
254 }
255}
256
258{
259 xwer_t rc;
260 if (nullptr != mSeqlock) {
262 union xwos_ulock lock;
263 xwsq_t lkst;
264 lock.osal.sqlk = &mSeqlock->mLock;
265 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
266 &lkst);
267 if (rc < 0) {
268 if (XWOS_LKST_UNLOCKED == lkst) {
269 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
270 }
271 }
272 } else {
273 rc = -ENOLCK;
274 }
275 } else {
276 rc = -EFAULT;
277 }
278 return rc;
279}
280
282{
283 xwer_t rc;
284 if (nullptr != mSeqlock) {
286 union xwos_ulock lock;
287 xwsq_t lkst;
288 lock.osal.sqlk = &mSeqlock->mLock;
289 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
290 to, &lkst);
291 if (rc < 0) {
292 if (XWOS_LKST_UNLOCKED == lkst) {
293 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
294 }
295 }
296 } else {
297 rc = -ENOLCK;
298 }
299 } else {
300 rc = -EFAULT;
301 }
302 return rc;
303}
304
305/* Seqlock::TryRdexLkBhGrd Non-static Member */
307 : RdexLkBhGrd()
308{
309 mSeqlock = seqlock;
310 if (nullptr != mSeqlock) {
312 if (XWOK != mRc) {
313 mSeqlock = nullptr;
314 }
315 }
316}
317
319 : RdexLkBhGrd()
320{
321 mSeqlock = &seqlock;
322 if (nullptr != mSeqlock) {
324 if (XWOK != mRc) {
325 mSeqlock = nullptr;
326 }
327 }
328}
329
330/* Seqlock::RdexLkIrqsGrd Non-static Member */
331template<xwirq_t ... TIrqList>
333 : mSeqlock(seqlock)
335 , mIrqs{TIrqList ...}
336{
337 if (nullptr != mSeqlock) {
339 sizeof...(TIrqList));
341 }
342}
343
344template<xwirq_t ... TIrqList>
346 : mSeqlock(&seqlock)
348 , mIrqs{TIrqList ...}
349{
350 if (nullptr != mSeqlock) {
352 sizeof...(TIrqList));
354 }
355}
356
357template<xwirq_t ... TIrqList>
359{
360 if (nullptr != mSeqlock) {
363 xwos_sqlk_rdex_unlock_irqsrs(&mSeqlock->mLock, mIrqs, mIrqFlags,
364 sizeof...(TIrqList));
365 }
366 }
367}
368
369template<xwirq_t ... TIrqList>
371{
372 xwer_t rc;
373 if (nullptr != mSeqlock) {
375 union xwos_ulock lock;
376 xwsq_t lkst;
377 lock.osal.sqlk = &mSeqlock->mLock;
378 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
379 &lkst);
380 if (rc < 0) {
381 if (XWOS_LKST_UNLOCKED == lkst) {
382 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
383 }
384 }
385 } else {
386 rc = -ENOLCK;
387 }
388 } else {
389 rc = -EFAULT;
390 }
391 return rc;
392}
393
394template<xwirq_t ... TIrqList>
396{
397 xwer_t rc;
398 if (nullptr != mSeqlock) {
400 union xwos_ulock lock;
401 xwsq_t lkst;
402 lock.osal.sqlk = &mSeqlock->mLock;
403 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_RDEX, nullptr,
404 to, &lkst);
405 if (rc < 0) {
406 if (XWOS_LKST_UNLOCKED == lkst) {
407 xwos_sqlk_rdex_lock(&mSeqlock->mLock);
408 }
409 }
410 } else {
411 rc = -ENOLCK;
412 }
413 } else {
414 rc = -EFAULT;
415 }
416 return rc;
417}
418
419/* Seqlock::TryRdexLkIrqsGrd Non-static Member */
420template<xwirq_t ... TIrqList>
422 : RdexLkIrqsGrd<TIrqList ...>()
423{
424 RdexLkIrqsGrd<TIrqList ...>::mSeqlock = seqlock;
429 sizeof...(TIrqList));
430 if (XWOK != mRc) {
431 RdexLkIrqsGrd<TIrqList ...>::mSeqlock = nullptr;
432 }
433 }
434}
435
436template<xwirq_t ... TIrqList>
438 : RdexLkIrqsGrd<TIrqList ...>()
439{
440 RdexLkIrqsGrd<TIrqList ...>::mSeqlock = seqlock;
445 sizeof...(TIrqList));
446 if (XWOK != mRc) {
447 RdexLkIrqsGrd<TIrqList ...>::mSeqlock = nullptr;
448 }
449 }
450}
451
452/* Seqlock::WrLkGrd Non-static Member */
454 : mSeqlock(seqlock)
456{
457 if (nullptr != mSeqlock) {
460 }
461}
462
464 : mSeqlock(&seqlock)
466{
467 if (nullptr != mSeqlock) {
470 }
471}
472
474{
475 if (nullptr != mSeqlock) {
478 xwos_sqlk_wr_unlock(&mSeqlock->mLock);
479 }
480 }
481}
482
484{
485 xwer_t rc;
486 if (nullptr != mSeqlock) {
488 union xwos_ulock lock;
489 xwsq_t lkst;
490 lock.osal.sqlk = &mSeqlock->mLock;
491 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
492 &lkst);
493 if (rc < 0) {
494 if (XWOS_LKST_UNLOCKED == lkst) {
495 xwos_sqlk_wr_lock(&mSeqlock->mLock);
496 }
497 }
498 } else {
499 rc = -ENOLCK;
500 }
501 } else {
502 rc = -EFAULT;
503 }
504 return rc;
505}
506
508{
509 xwer_t rc;
510 if (nullptr != mSeqlock) {
512 union xwos_ulock lock;
513 xwsq_t lkst;
514 lock.osal.sqlk = &mSeqlock->mLock;
515 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
516 to, &lkst);
517 if (rc < 0) {
518 if (XWOS_LKST_UNLOCKED == lkst) {
519 xwos_sqlk_wr_lock(&mSeqlock->mLock);
520 }
521 }
522 } else {
523 rc = -ENOLCK;
524 }
525 } else {
526 rc = -EFAULT;
527 }
528 return rc;
529}
530
531/* Seqlock::TryWrLkGrd Non-static Member */
533 : WrLkGrd()
534{
535 mSeqlock = seqlock;
536 if (nullptr != mSeqlock) {
538 if (XWOK != mRc) {
539 mSeqlock = nullptr;
540 }
541 }
542}
543
545 : WrLkGrd()
546{
547 mSeqlock = &seqlock;
548 if (nullptr != mSeqlock) {
550 if (XWOK != mRc) {
551 mSeqlock = nullptr;
552 }
553 }
554}
555
556/* Seqlock::WrLkThGrd Non-static Member */
558 : mSeqlock(seqlock)
560{
561 if (nullptr != mSeqlock) {
564 }
565}
566
568 : mSeqlock(&seqlock)
570{
571 if (nullptr != mSeqlock) {
574 }
575}
576
578{
579 if (nullptr != mSeqlock) {
582 xwos_sqlk_wr_unlock_cpuirqrs(&mSeqlock->mLock, mCpuirq);
583 }
584 }
585}
586
588{
589 xwer_t rc;
590 if (nullptr != mSeqlock) {
592 union xwos_ulock lock;
593 xwsq_t lkst;
594 lock.osal.sqlk = &mSeqlock->mLock;
595 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
596 &lkst);
597 if (rc < 0) {
598 if (XWOS_LKST_UNLOCKED == lkst) {
599 xwos_sqlk_wr_lock(&mSeqlock->mLock);
600 }
601 }
602 } else {
603 rc = -ENOLCK;
604 }
605 } else {
606 rc = -EFAULT;
607 }
608 return rc;
609}
610
612{
613 xwer_t rc;
614 if (nullptr != mSeqlock) {
616 union xwos_ulock lock;
617 xwsq_t lkst;
618 lock.osal.sqlk = &mSeqlock->mLock;
619 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
620 to, &lkst);
621 if (rc < 0) {
622 if (XWOS_LKST_UNLOCKED == lkst) {
623 xwos_sqlk_wr_lock(&mSeqlock->mLock);
624 }
625 }
626 } else {
627 rc = -ENOLCK;
628 }
629 } else {
630 rc = -EFAULT;
631 }
632 return rc;
633}
634
635/* Seqlock::TryWrLkThGrd Non-static Member */
637 : WrLkThGrd()
638{
639 mSeqlock = seqlock;
640 if (nullptr != mSeqlock) {
642 if (XWOK != mRc) {
643 mSeqlock = nullptr;
644 }
645 }
646}
647
649 : WrLkThGrd()
650{
651 mSeqlock = &seqlock;
652 if (nullptr != mSeqlock) {
654 if (XWOK != mRc) {
655 mSeqlock = nullptr;
656 }
657 }
658}
659
660/* Seqlock::WrLkBhGrd Non-static Member */
662 : mSeqlock(seqlock)
664{
665 if (nullptr != mSeqlock) {
668 }
669}
670
672 : mSeqlock(&seqlock)
674{
675 if (nullptr != mSeqlock) {
678 }
679}
680
682{
683 if (nullptr != mSeqlock) {
686 xwos_sqlk_wr_unlock_bh(&mSeqlock->mLock);
687 }
688 }
689}
690
692{
693 xwer_t rc;
694 if (nullptr != mSeqlock) {
696 union xwos_ulock lock;
697 xwsq_t lkst;
698 lock.osal.sqlk = &mSeqlock->mLock;
699 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
700 &lkst);
701 if (rc < 0) {
702 if (XWOS_LKST_UNLOCKED == lkst) {
703 xwos_sqlk_wr_lock(&mSeqlock->mLock);
704 }
705 }
706 } else {
707 rc = -ENOLCK;
708 }
709 } else {
710 rc = -EFAULT;
711 }
712 return rc;
713}
714
716{
717 xwer_t rc;
718 if (nullptr != mSeqlock) {
720 union xwos_ulock lock;
721 xwsq_t lkst;
722 lock.osal.sqlk = &mSeqlock->mLock;
723 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
724 to, &lkst);
725 if (rc < 0) {
726 if (XWOS_LKST_UNLOCKED == lkst) {
727 xwos_sqlk_wr_lock(&mSeqlock->mLock);
728 }
729 }
730 } else {
731 rc = -ENOLCK;
732 }
733 } else {
734 rc = -EFAULT;
735 }
736 return rc;
737}
738
739/* Seqlock::TryWrLkBhGrd Non-static Member */
741 : WrLkBhGrd()
742{
743 mSeqlock = seqlock;
744 if (nullptr != mSeqlock) {
746 if (XWOK != mRc) {
747 mSeqlock = nullptr;
748 }
749 }
750}
751
753 : WrLkBhGrd()
754{
755 mSeqlock = &seqlock;
756 if (nullptr != mSeqlock) {
758 if (XWOK != mRc) {
759 mSeqlock = nullptr;
760 }
761 }
762}
763
764/* Seqlock::WrLkIrqsGrd Non-static Member */
765template<xwirq_t ... TIrqList>
767 : mSeqlock(seqlock)
769 , mIrqs{TIrqList ...}
770{
771 if (nullptr != mSeqlock) {
773 sizeof...(TIrqList));
775 }
776}
777
778template<xwirq_t ... TIrqList>
780 : mSeqlock(&seqlock)
782 , mIrqs{TIrqList ...}
783{
784 if (nullptr != mSeqlock) {
786 sizeof...(TIrqList));
788 }
789}
790
791template<xwirq_t ... TIrqList>
793{
794 if (nullptr != mSeqlock) {
797 xwos_sqlk_wr_unlock_irqsrs(&mSeqlock->mLock, mIrqs, mIrqFlags,
798 sizeof...(TIrqList));
799 }
800 }
801}
802
803template<xwirq_t ... TIrqList>
805{
806 xwer_t rc;
807 if (nullptr != mSeqlock) {
809 union xwos_ulock lock;
810 xwsq_t lkst;
811 lock.osal.sqlk = &mSeqlock->mLock;
812 rc = xwos_cond_wait(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
813 &lkst);
814 if (rc < 0) {
815 if (XWOS_LKST_UNLOCKED == lkst) {
816 xwos_sqlk_wr_lock(&mSeqlock->mLock);
817 }
818 }
819 } else {
820 rc = -ENOLCK;
821 }
822 } else {
823 rc = -EFAULT;
824 }
825 return rc;
826}
827
828template<xwirq_t ... TIrqList>
830{
831 xwer_t rc;
832 if (nullptr != mSeqlock) {
834 union xwos_ulock lock;
835 xwsq_t lkst;
836 lock.osal.sqlk = &mSeqlock->mLock;
837 rc = xwos_cond_wait_to(cond->getXwosObj(), lock, XWOS_LK_SQLK_WR, nullptr,
838 to, &lkst);
839 if (rc < 0) {
840 if (XWOS_LKST_UNLOCKED == lkst) {
841 xwos_sqlk_wr_lock(&mSeqlock->mLock);
842 }
843 }
844 } else {
845 rc = -ENOLCK;
846 }
847 } else {
848 rc = -EFAULT;
849 }
850 return rc;
851}
852
853/* Seqlock::TryWrLkIrqsGrd Non-static Member */
854template<xwirq_t ... TIrqList>
856 : WrLkIrqsGrd<TIrqList ...>()
857{
858 WrLkIrqsGrd<TIrqList ...>::mSeqlock = seqlock;
863 sizeof...(TIrqList));
864 if (XWOK != mRc) {
865 WrLkIrqsGrd<TIrqList ...>::mSeqlock = nullptr;
866 }
867 }
868}
869
870template<xwirq_t ... TIrqList>
872 : WrLkIrqsGrd<TIrqList ...>()
873{
874 WrLkIrqsGrd<TIrqList ...>::mSeqlock = seqlock;
879 sizeof...(TIrqList));
880 if (XWOK != mRc) {
881 WrLkIrqsGrd<TIrqList ...>::mSeqlock = nullptr;
882 }
883 }
884}
885
886/* Seqlock Non-static Member */
888{
890}
891
893{
894}
895
897{
898 return xwos_sqlk_rd_begin(&mLock);
899}
900
902{
903 return xwos_sqlk_rd_retry(&mLock, start);
904}
905
907{
908 return xwos_sqlk_get_seq(&mLock);
909}
910
911} // namespace xwos
912} // namespace lock
xwos::lock::Seqlock
独占读中断底半部上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:801
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:257
~RdexLkBhGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:247
独占读普通上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:485
~RdexLkGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:39
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:49
独占读部分中断上锁模式的顺序锁RAII机制守卫
Definition Seqlock.hxx:961
xwreg_t mIrqFlags[sizeof...(TIrqList)]
Definition Seqlock.hxx:966
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:370
xwirq_t mIrqs[sizeof...(TIrqList)]
Definition Seqlock.hxx:965
~RdexLkIrqsGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:358
独占读CPU中断上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:642
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:153
~RdexLkThGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:143
TryRdexLkBhGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:306
TryRdexLkGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:98
TryRdexLkIrqsGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:421
TryRdexLkThGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:202
TryWrLkBhGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:740
TryWrLkGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:532
TryWrLkIrqsGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:855
TryWrLkThGrd(Seqlock *seqlock)
构造顺序锁的RAII机制守卫
Definition Seqlock.cxx:636
独占写中断底半部上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:1440
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:691
~WrLkBhGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:681
独占写普通上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:1123
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:483
~WrLkGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:473
独占写部分中断上锁模式的顺序锁RAII机制守卫
Definition Seqlock.hxx:1600
xwirq_t mIrqs[sizeof...(TIrqList)]
Definition Seqlock.hxx:1604
xwreg_t mIrqFlags[sizeof...(TIrqList)]
Definition Seqlock.hxx:1605
~WrLkIrqsGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:792
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:804
独占写CPU中断上锁模式下的顺序锁RAII机制守卫
Definition Seqlock.hxx:1281
~WrLkThGrd()
析构顺序锁的RAII机制守卫
Definition Seqlock.cxx:577
xwer_t wait(sync::Cond *cond)
等待条件量
Definition Seqlock.cxx:587
xwsq_t readBegin()
开启共享读临界区
Definition Seqlock.cxx:896
xwsq_t getSeq()
获取顺序锁的顺序值
Definition Seqlock.cxx:906
struct xwos_sqlk mLock
Definition Seqlock.hxx:1753
bool readRetry(xwsq_t start)
关闭共享读临界区,并检查是否需要重试
Definition Seqlock.cxx:901
条件量基类
Definition Cond.hxx:31
struct xwos_cond * getXwosObj()
Definition Cond.hxx:45
#define EFAULT
Bad address
Definition errno.h:44
#define ENOLCK
No lock
Definition errno.h:76
#define XWOK
No error
Definition errno.h:182
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
signed int xwirq_t
Definition type.h:517
unsigned long xwsq_t
Definition type.h:445
@ XWOS_LKST_UNLOCKED
Definition type.h:661
@ XWOS_LK_SQLK_RDEX
Definition type.h:644
@ XWOS_LK_SQLK_WR
Definition type.h:643
static xwer_t xwos_sqlk_wr_trylock_cpuirqsv(struct xwos_sqlk *sql, xwreg_t *cpuirq)
XWOS API:尝试开启写临界区,保存本地CPU的中断标志并关闭
Definition seqlock.h:599
static void xwos_sqlk_rdex_lock(struct xwos_sqlk *sql)
XWOS API:开启独占读临界区
Definition seqlock.h:189
static void xwos_sqlk_wr_unlock(struct xwos_sqlk *sql)
XWOS API:关闭写临界区
Definition seqlock.h:520
static void xwos_sqlk_rdex_unlock_irqsrs(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:关闭独占读临界区,恢复部分中断的中断标志
Definition seqlock.h:429
static void xwos_sqlk_wr_lock(struct xwos_sqlk *sql)
XWOS API:开启写临界区
Definition seqlock.h:491
static void xwos_sqlk_init(struct xwos_sqlk *sql)
XWOS API:初始化顺序锁
Definition seqlock.h:133
static xwer_t xwos_sqlk_wr_trylock_irqssv(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:尝试开启写临界区,保存部分中断的中断标志并关闭
Definition seqlock.h:715
static void xwos_sqlk_rdex_unlock(struct xwos_sqlk *sql)
XWOS API:关闭独占读临界区
Definition seqlock.h:218
static void xwos_sqlk_wr_unlock_bh(struct xwos_sqlk *sql)
XWOS API:关闭写临界区,开启本地CPU的中断底半部
Definition seqlock.h:782
static xwsq_t xwos_sqlk_get_seq(struct xwos_sqlk *sql)
XWOS API:获取顺序锁的顺序值
Definition seqlock.h:175
static xwer_t xwos_sqlk_wr_trylock_bh(struct xwos_sqlk *sql)
XWOS API:尝试开启写临界区,关闭本地CPU的中断底半部
Definition seqlock.h:768
static void xwos_sqlk_rdex_unlock_bh(struct xwos_sqlk *sql)
XWOS API:关闭独占读临界区,开启本地CPU的中断底半部
Definition seqlock.h:477
static xwer_t xwos_sqlk_wr_trylock(struct xwos_sqlk *sql)
XWOS API:尝试开启写临界区
Definition seqlock.h:506
static void xwos_sqlk_wr_lock_irqssv(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:开启写临界区,保存部分中断的中断标志并关闭
Definition seqlock.h:692
static void xwos_sqlk_rdex_unlock_cpuirqrs(struct xwos_sqlk *sql, xwreg_t cpuirq)
XWOS API:关闭独占读临界区,恢复本地CPU的中断标志
Definition seqlock.h:311
static void xwos_sqlk_rdex_lock_irqssv(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:开启独占读临界区,保存部分中断的中断标志并关闭
Definition seqlock.h:389
static xwer_t xwos_sqlk_rdex_trylock_cpuirqsv(struct xwos_sqlk *sql, xwreg_t *cpuirq)
XWOS API:尝试开启独占读临界区,保存本地CPU的中断标志并关闭
Definition seqlock.h:297
static xwsq_t xwos_sqlk_rd_begin(struct xwos_sqlk *sql)
XWOS API:开启共享读临界区
Definition seqlock.h:148
static void xwos_sqlk_rdex_lock_cpuirqsv(struct xwos_sqlk *sql, xwreg_t *cpuirq)
XWOS API:开启独占读临界区,保存本地CPU的中断标志并关闭
Definition seqlock.h:278
static xwer_t xwos_sqlk_rdex_trylock(struct xwos_sqlk *sql)
XWOS API:尝试开启独占读临界区
Definition seqlock.h:206
static xwer_t xwos_sqlk_rdex_trylock_bh(struct xwos_sqlk *sql)
XWOS API:尝试开启独占读临界区,关闭本地CPU的中断底半部
Definition seqlock.h:465
static void xwos_sqlk_wr_lock_cpuirqsv(struct xwos_sqlk *sql, xwreg_t *cpuirq)
XWOS API:开启写临界区,保存本地CPU的中断标志并关闭
Definition seqlock.h:580
static bool xwos_sqlk_rd_retry(struct xwos_sqlk *sql, xwsq_t start)
XWOS API:关闭共享读临界区,并检查是否需要重试
Definition seqlock.h:163
static void xwos_sqlk_wr_unlock_irqsrs(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:关闭写临界区,恢复部分中断的中断标志
Definition seqlock.h:732
static void xwos_sqlk_rdex_lock_bh(struct xwos_sqlk *sql)
XWOS API:开启独占读临界区,关闭本地CPU的中断底半部
Definition seqlock.h:447
static void xwos_sqlk_wr_unlock_cpuirqrs(struct xwos_sqlk *sql, xwreg_t cpuirq)
XWOS API:关闭写临界区,恢复本地CPU的中断标志
Definition seqlock.h:613
static xwer_t xwos_sqlk_rdex_trylock_irqssv(struct xwos_sqlk *sql, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:尝试开启独占读临界区,保存部分中断的中断标志并关闭
Definition seqlock.h:412
static void xwos_sqlk_wr_lock_bh(struct xwos_sqlk *sql)
XWOS API:开启写临界区,关闭本地CPU的中断底半部
Definition seqlock.h:750
static xwer_t xwos_cond_wait(struct xwos_cond *cond, union xwos_ulock lock, xwsq_t lktype, void *lkdata, xwsq_t *lkst)
XWOS API:等待条件量
Definition cond.h:432
static xwer_t xwos_cond_wait_to(struct xwos_cond *cond, union xwos_ulock lock, xwsq_t lktype, void *lkdata, xwtm_t to, xwsq_t *lkst)
XWOS API:限时等待条件量
Definition cond.h:492
Definition Cpu.hxx:19
所有锁的联合
Definition type.h:680
union xwos_ulock::@8 osal
struct xwmp_sqlk * sqlk
Definition type.h:684