Skip to content

Commit 822341d

Browse files
committed
doc: moved the document section "ngx.semaphore" to a better place.
1 parent 18551f7 commit 822341d

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

README.markdown

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,14 +2762,14 @@ Nginx API for Lua
27622762
* [ngx.worker.pid](#ngxworkerpid)
27632763
* [ngx.worker.count](#ngxworkercount)
27642764
* [ngx.worker.id](#ngxworkerid)
2765+
* [ngx.semaphore](#ngxsemaphore)
27652766
* [ndk.set_var.DIRECTIVE](#ndkset_vardirective)
27662767
* [coroutine.create](#coroutinecreate)
27672768
* [coroutine.resume](#coroutineresume)
27682769
* [coroutine.yield](#coroutineyield)
27692770
* [coroutine.wrap](#coroutinewrap)
27702771
* [coroutine.running](#coroutinerunning)
27712772
* [coroutine.status](#coroutinestatus)
2772-
* [ngx.semaphore](#ngxsemaphore)
27732773

27742774

27752775
[Back to TOC](#table-of-contents)
@@ -7190,6 +7190,27 @@ This API was first introduced in the `0.9.20` release.
71907190

71917191
[Back to TOC](#nginx-api-for-lua)
71927192

7193+
ngx.semaphore
7194+
-------------
7195+
**syntax:** *local semaphore = require "ngx.semaphore"*
7196+
7197+
This is a Lua module that implements a classic-style semaphore API for efficient synchronizations among
7198+
different "light threads". Sharing the same semaphore among different "light threads" created in different (request)
7199+
contexts are also supported as long as the "light threads" reside in the same NGINX worker process
7200+
and the [lua_code_cache](#lua_code_cache) directive is turned on (which is the default).
7201+
7202+
This Lua module does not ship with this ngx_lua module itself rather it is shipped with
7203+
the
7204+
[lua-resty-core](https://github.com/openresty/lua-resty-core) library.
7205+
7206+
Please refer to the [documentation](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/semaphore.md)
7207+
for this `ngx.semaphore` Lua module in [lua-resty-core](https://github.com/openresty/lua-resty-core)
7208+
for more details.
7209+
7210+
This feature requires at least ngx_lua `v0.9.21`.
7211+
7212+
[Back to TOC](#nginx-api-for-lua)
7213+
71937214
ndk.set_var.DIRECTIVE
71947215
---------------------
71957216
**syntax:** *res = ndk.set_var.DIRECTIVE_NAME*
@@ -7321,27 +7342,6 @@ This API was first enabled in the `v0.6.0` release.
73217342

73227343
[Back to TOC](#nginx-api-for-lua)
73237344

7324-
ngx.semaphore
7325-
-------------
7326-
**syntax:** *local semaphore = require "ngx.semaphore"*
7327-
7328-
This is a Lua module that implements a classic-style semaphore API for efficient synchronizations among
7329-
different "light threads". Sharing the same semaphore among different "light threads" created in different (request)
7330-
contexts are also supported as long as the "light threads" reside in the same NGINX worker process
7331-
and the [lua_code_cache](#lua_code_cache) directive is turned on (which is the default).
7332-
7333-
This Lua module does not ship with this ngx_lua module itself rather it is shipped with
7334-
the
7335-
[lua-resty-core](https://github.com/openresty/lua-resty-core) library.
7336-
7337-
Please refer to the [documentation](https://github.com/cuiweixie/lua-resty-core/blob/semaphore/lib/ngx/semaphore.md)
7338-
for this `ngx.semaphore` Lua module in [lua-resty-core](https://github.com/openresty/lua-resty-core)
7339-
for more details.
7340-
7341-
This feature requires at least ngx_lua `v0.9.21`.
7342-
7343-
[Back to TOC](#nginx-api-for-lua)
7344-
73457345
Obsolete Sections
73467346
=================
73477347

doc/HttpLuaModule.wiki

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6081,6 +6081,24 @@ See also [[#ngx.worker.count|ngx.worker.count]].
60816081
60826082
This API was first introduced in the <code>0.9.20</code> release.
60836083
6084+
== ngx.semaphore ==
6085+
'''syntax:''' ''local semaphore = require "ngx.semaphore"''
6086+
6087+
This is a Lua module that implements a classic-style semaphore API for efficient synchronizations among
6088+
different "light threads". Sharing the same semaphore among different "light threads" created in different (request)
6089+
contexts are also supported as long as the "light threads" reside in the same NGINX worker process
6090+
and the [[#lua_code_cache|lua_code_cache]] directive is turned on (which is the default).
6091+
6092+
This Lua module does not ship with this ngx_lua module itself rather it is shipped with
6093+
the
6094+
[https://github.com/openresty/lua-resty-core lua-resty-core] library.
6095+
6096+
Please refer to the [https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/semaphore.md documentation]
6097+
for this <code>ngx.semaphore</code> Lua module in [https://github.com/openresty/lua-resty-core lua-resty-core]
6098+
for more details.
6099+
6100+
This feature requires at least ngx_lua <code>v0.9.21</code>.
6101+
60846102
== ndk.set_var.DIRECTIVE ==
60856103
'''syntax:''' ''res = ndk.set_var.DIRECTIVE_NAME''
60866104
@@ -6190,24 +6208,6 @@ This API was first usable in the context of [[#init_by_lua|init_by_lua*]] since
61906208
61916209
This API was first enabled in the <code>v0.6.0</code> release.
61926210
6193-
== ngx.semaphore ==
6194-
'''syntax:''' ''local semaphore = require "ngx.semaphore"''
6195-
6196-
This is a Lua module that implements a classic-style semaphore API for efficient synchronizations among
6197-
different "light threads". Sharing the same semaphore among different "light threads" created in different (request)
6198-
contexts are also supported as long as the "light threads" reside in the same NGINX worker process
6199-
and the [[#lua_code_cache|lua_code_cache]] directive is turned on (which is the default).
6200-
6201-
This Lua module does not ship with this ngx_lua module itself rather it is shipped with
6202-
the
6203-
[https://github.com/openresty/lua-resty-core lua-resty-core] library.
6204-
6205-
Please refer to the [https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/semaphore.md documentation]
6206-
for this <code>ngx.semaphore</code> Lua module in [https://github.com/openresty/lua-resty-core lua-resty-core]
6207-
for more details.
6208-
6209-
This feature requires at least ngx_lua <code>v0.9.21</code>.
6210-
62116211
= Obsolete Sections =
62126212
62136213
This section is just holding obsolete documentation sections that have been either renamed or removed so that existing links over the web are still valid.

0 commit comments

Comments
 (0)