2525 #include < sys/syscall.h>
2626 #include < semaphore.h>
2727#endif
28+
29+ #include " Exports.h"
2830#include " SmartPointer.h"
2931
30- #ifdef _MSC_VER
31- #ifdef _USRDLL
32- #define EXPORT_DECL _declspec (dllexport)
33- #else
34- #define EXPORT_DECL __declspec (dllimport)
35- #endif
36- #else
37- #define EXPORT_DECL
38- #endif
3932namespace dolphindb {
4033
4134class Thread ;
@@ -109,17 +102,17 @@ class EXPORT_DECL RWLock{
109102#endif
110103};
111104
112- class EXPORT_DECL RWSpinLock{
113- public:
114- RWSpinLock (){};
115- ~RWSpinLock (){};
116- void acquireRead (){}
117- void acquireWrite (){}
118- void releaseRead (){}
119- void releaseWrite (){}
120- private:
105+ // class EXPORT_DECL RWSpinLock{
106+ // public:
107+ // RWSpinLock(){};
108+ // ~RWSpinLock(){};
109+ // void acquireRead(){}
110+ // void acquireWrite(){}
111+ // void releaseRead(){}
112+ // void releaseWrite(){}
113+ // private:
121114
122- };
115+ // };
123116
124117class EXPORT_DECL ConditionalVariable{
125118public:
@@ -140,7 +133,7 @@ class EXPORT_DECL ConditionalVariable{
140133
141134
142135template <class T >
143- class LockGuard {
136+ class EXPORT_DECL LockGuard{
144137public:
145138 LockGuard (T* res, bool acquireLock = true ):res_(res){
146139 if (acquireLock)
@@ -182,7 +175,7 @@ class TryLockGuard{
182175};
183176
184177template <class T >
185- class RWLockGuard {
178+ class EXPORT_DECL RWLockGuard{
186179public:
187180 RWLockGuard (T* res, bool exclusive, bool acquireLock = true ):res_(res), exclusive_(exclusive), acquireLock_(acquireLock){
188181 if (res != NULL && acquireLock_){
@@ -431,7 +424,7 @@ class SynchronizedQueue{
431424 return true ;
432425 }
433426
434- int size (){
427+ std:: size_t size (){
435428 LockGuard<Mutex> guard (&mutex_);
436429 return items_.size ();
437430 }
@@ -572,7 +565,7 @@ class BlockingQueue {
572565 : buf_(new T[maxItems]), capacity_(maxItems), batchSize_(1 ), size_(0 ), head_(0 ), tail_(0 ) {}
573566 explicit BlockingQueue (size_t maxItems, size_t batchSize)
574567 : buf_(new T[maxItems]), capacity_(maxItems), batchSize_(batchSize), size_(0 ), head_(0 ), tail_(0 ) {}
575- int size (){
568+ std:: size_t size (){
576569 LockGuard<Mutex> guard (&lock_);
577570 return size_;
578571 }
@@ -631,9 +624,9 @@ class BlockingQueue {
631624 }
632625 if (size_ == 0 )
633626 return false ;
634- int n = std::min (batchSize_, size_);
627+ std:: size_t n = std::min (batchSize_, size_);
635628 items.resize (n);
636- for (int i = 0 ; i < n; i++){
629+ for (std:: size_t i = 0 ; i < n; i++){
637630 items[i] = std::move (buf_[head_]);
638631 buf_[head_] = T ();
639632 head_ = (head_ + 1 ) % capacity_;
0 commit comments