git: 8205a77b96b7 - main - devel/pecl-swoole: update to 4.8.12, also fix error with SWOOLE_PROCESS.

From: Vanilla I. Shu <vanilla_at_FreeBSD.org>
Date: Sun, 02 Oct 2022 03:44:57 UTC
The branch main has been updated by vanilla:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8205a77b96b7a543a8306b1a5f37ac6ae1ef1103

commit 8205a77b96b7a543a8306b1a5f37ac6ae1ef1103
Author:     Vanilla I. Shu <vanilla@FreeBSD.org>
AuthorDate: 2022-10-02 03:43:40 +0000
Commit:     Vanilla I. Shu <vanilla@FreeBSD.org>
CommitDate: 2022-10-02 03:44:46 +0000

    devel/pecl-swoole: update to 4.8.12, also fix error with SWOOLE_PROCESS.
    
    PR:             266555
    Reported by:    Ricardo Sette <ricardohfsp at gmail.com>
---
 devel/pecl-swoole/Makefile                         |  2 +-
 devel/pecl-swoole/distinfo                         |  6 ++--
 .../files/patch-ext-src_php__swoole__private.h     |  4 +--
 .../pecl-swoole/files/patch-src_server_manager.cc  | 14 +++++++++
 devel/pecl-swoole/files/patch-src_server_master.cc | 36 ++++++++++++++++++++++
 5 files changed, 56 insertions(+), 6 deletions(-)

diff --git a/devel/pecl-swoole/Makefile b/devel/pecl-swoole/Makefile
index a71d738055a9..8fdfa6bb6d55 100644
--- a/devel/pecl-swoole/Makefile
+++ b/devel/pecl-swoole/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	swoole
-PORTVERSION=	4.8.11
+PORTVERSION=	4.8.12
 CATEGORIES=	devel net
 
 MAINTAINER=	vanilla@FreeBSD.org
diff --git a/devel/pecl-swoole/distinfo b/devel/pecl-swoole/distinfo
index 78e8e1b0bb49..33d1f6bfc07b 100644
--- a/devel/pecl-swoole/distinfo
+++ b/devel/pecl-swoole/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1657667124
-SHA256 (PECL/swoole-4.8.11.tgz) = 307ddd7909e24c8edd7f650d7caeefd6a90fe49c721b0de3f5a7407990430f67
-SIZE (PECL/swoole-4.8.11.tgz) = 1855159
+TIMESTAMP = 1664681702
+SHA256 (PECL/swoole-4.8.12.tgz) = 0a0b844992d26c974957749ada86a9ff7a88daa512b7255db4fc41afa062f4a4
+SIZE (PECL/swoole-4.8.12.tgz) = 2097350
diff --git a/devel/pecl-swoole/files/patch-ext-src_php__swoole__private.h b/devel/pecl-swoole/files/patch-ext-src_php__swoole__private.h
index 2d9fc4523cc7..f47c6e5e84d0 100644
--- a/devel/pecl-swoole/files/patch-ext-src_php__swoole__private.h
+++ b/devel/pecl-swoole/files/patch-ext-src_php__swoole__private.h
@@ -1,6 +1,6 @@
---- ext-src/php_swoole_private.h.orig	2021-10-29 10:11:22 UTC
+--- ext-src/php_swoole_private.h.orig	2022-07-12 01:57:52 UTC
 +++ ext-src/php_swoole_private.h
-@@ -891,7 +891,7 @@ static sw_inline zend_bool sw_zend_is_callable_at_fram
+@@ -905,7 +905,7 @@ static sw_inline zend_bool sw_zend_is_callable_at_fram
                                                          char **error) {
      zend_string *name;
      zend_bool ret;
diff --git a/devel/pecl-swoole/files/patch-src_server_manager.cc b/devel/pecl-swoole/files/patch-src_server_manager.cc
new file mode 100644
index 000000000000..86ce44d49ce1
--- /dev/null
+++ b/devel/pecl-swoole/files/patch-src_server_manager.cc
@@ -0,0 +1,14 @@
+--- src/server/manager.cc.orig	2022-07-12 01:57:55 UTC
++++ src/server/manager.cc
+@@ -247,7 +247,11 @@ void Manager::start(Server *_server) {
+ #endif
+ 
+ #ifdef HAVE_PTHREAD_BARRIER
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++    SW_START_SLEEP;
++#else
+     pthread_barrier_wait(&_server->gs->manager_barrier);
++#endif
+ #else
+     SW_START_SLEEP;
+ #endif
diff --git a/devel/pecl-swoole/files/patch-src_server_master.cc b/devel/pecl-swoole/files/patch-src_server_master.cc
new file mode 100644
index 000000000000..36de9891106b
--- /dev/null
+++ b/devel/pecl-swoole/files/patch-src_server_master.cc
@@ -0,0 +1,36 @@
+--- src/server/master.cc.orig	2022-07-12 01:57:55 UTC
++++ src/server/master.cc
+@@ -448,7 +448,11 @@ int Server::start_master_thread() {
+     if (!single_thread) {
+         pthread_barrier_wait(&reactor_thread_barrier);
+     }
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++    SW_START_SLEEP;
++#else
+     pthread_barrier_wait(&gs->manager_barrier);
++#endif
+ #else
+     SW_START_SLEEP;
+ #endif
+@@ -850,8 +854,10 @@ int Server::create() {
+ #ifdef HAVE_PTHREAD_BARRIER
+     if (is_process_mode()) {
+         pthread_barrier_init(&reactor_thread_barrier, nullptr, reactor_num + 1);
++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+         pthread_barrierattr_setpshared(&gs->manager_barrier_attr, PTHREAD_PROCESS_SHARED);
+         pthread_barrier_init(&gs->manager_barrier, &gs->manager_barrier_attr, 2);
++#endif
+     }
+ #endif
+ 
+@@ -983,8 +989,10 @@ void Server::destroy() {
+ #ifdef HAVE_PTHREAD_BARRIER
+     if (is_process_mode()) {
+         pthread_barrier_destroy(&reactor_thread_barrier);
++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+         pthread_barrier_destroy(&gs->manager_barrier);
+         pthread_barrierattr_destroy(&gs->manager_barrier_attr);
++#endif
+     }
+ #endif
+     sw_shm_free(session_list);