Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.macos.arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
brew install openssl gflags googletest gsasl
brew install openssl@3 gflags googletest gsasl

- name: Build
run: |
export OPENSSL_TOP=$(brew --prefix openssl@3)
export OPENSSL_VERSION=$(ls -1 $OPENSSL_TOP | grep -E '^[0-9]' | head -1)
export OPENSSL_DIR="$OPENSSL_TOP/$OPENSSL_VERSION"
cmake -B ${{github.workspace}}/build \
-D PHOTON_CXX_STANDARD=17 \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
<<<<<<< HEAD
-D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/[email protected]/1.1.1w
=======
-D OPENSSL_ROOT_DIR=${OPENSSL_DIR}
>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134))
cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

- name: Test
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci.macos.x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,29 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
<<<<<<< HEAD
brew install openssl gflags googletest gsasl nasm
=======
brew install openssl@3 gflags googletest gsasl nasm
>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134))

- name: Build
run: |
export OPENSSL_TOP=$(brew --prefix openssl@3)
export OPENSSL_VERSION=$(ls -1 $OPENSSL_TOP | grep -E '^[0-9]' | head -1)
export OPENSSL_DIR="$OPENSSL_TOP/$OPENSSL_VERSION"
cmake -B ${{github.workspace}}/build \
-D PHOTON_CXX_STANDARD=17 \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
<<<<<<< HEAD
-D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3
=======
-D OPENSSL_ROOT_DIR=${OPENSSL_DIR}
>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134))
cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

- name: Test
Expand Down
11 changes: 11 additions & 0 deletions thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ namespace photon
thread* pop_front()
{
auto ret = q[0];
if (q.size() == 1) {
q.pop_back();
return ret;
}
q[0] = q.back();
q[0]->idx = 0;
q.pop_back();
Expand All @@ -407,6 +411,11 @@ namespace photon
}

auto id = obj->idx;
if (q.size() == 1) {
assert(id == 0);
q.pop_back();
return 0;
}
q[obj->idx] = q.back();
q[id]->idx = id;
q.pop_back();
Expand All @@ -424,6 +433,7 @@ namespace photon
// compare m_nodes[idx] with parent node.
bool up(int idx)
{
assert(!q.empty());
auto tmp = q[idx];
bool ret = false;
while (idx != 0){
Expand All @@ -443,6 +453,7 @@ namespace photon
// compare m_nodes[idx] with child node.
bool down(int idx)
{
assert(!q.empty());
auto tmp = q[idx];
size_t cmpIdx = (idx << 1) + 1;
bool ret = false;
Expand Down