brbzull0 commented on a change in pull request #7611:
URL: https://github.com/apache/trafficserver/pull/7611#discussion_r599028613
##########
File path: include/tscore/ink_rwlock.h
##########
@@ -30,14 +30,20 @@
#pragma once
#include "tscore/ink_error.h"
+#include "tscore/ink_assert.h"
#include <pthread.h>
typedef pthread_rwlock_t ink_rwlock;
void ink_rwlock_init(ink_rwlock *rw);
void ink_rwlock_destroy(ink_rwlock *rw);
-static inline void
+// Instead of calling ink_rwlock_init(), an ink_rwlock instance can be
initialized with one of thsee values.
+//
+ink_rwlock const INK_RWLOCK_INIT =
PTHREAD_RWLOCK_INITIALIZER;
+ink_rwlock const INK_RWLOCK_INIT_NO_WRITER_STARVATION =
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;
Review comment:
```
[dmeden@bsd1 ~/code/walt]$ clang++ --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM
8.0.1)
[dmeden@bsd1 ~/code/walt]$ clang++ x.cc --std=c++17 -lpthread
[dmeden@bsd1 ~/code/walt]$ ./a.out
good
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]