Repository: trafficserver Updated Branches: refs/heads/master 851a52bc2 -> 20c8ba6cb
TS-1432: Adding TSMutexDestroy to API Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5bcbc1d0 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5bcbc1d0 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5bcbc1d0 Branch: refs/heads/master Commit: 5bcbc1d0ebfa32804522accfac91f02a9bca0eb4 Parents: 851a52b Author: Brian Geffon <[email protected]> Authored: Thu Nov 6 12:48:14 2014 -0800 Committer: Brian Geffon <[email protected]> Committed: Thu Nov 6 12:48:14 2014 -0800 ---------------------------------------------------------------------- doc/reference/api/TSMutexDestory.en.rst | 31 ++++++++++++++++++++++++++++ proxy/InkIOCoreAPI.cc | 8 +++++++ proxy/api/ts/ts.h | 1 + 3 files changed, 40 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5bcbc1d0/doc/reference/api/TSMutexDestory.en.rst ---------------------------------------------------------------------- diff --git a/doc/reference/api/TSMutexDestory.en.rst b/doc/reference/api/TSMutexDestory.en.rst new file mode 100644 index 0000000..ddb65d1 --- /dev/null +++ b/doc/reference/api/TSMutexDestory.en.rst @@ -0,0 +1,31 @@ +.. Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright + ownership. The ASF licenses this file to you under the Apache + License, Version 2.0 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + +TSMutexLock +=========== + +Synopsis +-------- + +`#include <ts/ts.h>` + +.. c:function:: void TSMutexDestroy(TSMutex mutexp) + + +Description +----------- +Destroys a mutex previously created via TSMutexCreate. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5bcbc1d0/proxy/InkIOCoreAPI.cc ---------------------------------------------------------------------- diff --git a/proxy/InkIOCoreAPI.cc b/proxy/InkIOCoreAPI.cc index 26f3298..59235db 100644 --- a/proxy/InkIOCoreAPI.cc +++ b/proxy/InkIOCoreAPI.cc @@ -189,6 +189,14 @@ TSMutexCreate() return (TSMutex)mutexp; } +void +TSMutexDestroy(TSMutex m) { + sdk_assert(sdk_sanity_check_mutex(m) == TS_SUCCESS); + ink_release_assert(((ProxyMutex*)m)->refcount() == 0); + + ((ProxyMutex*)m)->free(); +} + /* The following two APIs are for Into work, actually, APIs of Mutex should allow plugins to manually increase or decrease the refcount of the mutex pointer, plugins may want more control of the creation http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5bcbc1d0/proxy/api/ts/ts.h ---------------------------------------------------------------------- diff --git a/proxy/api/ts/ts.h b/proxy/api/ts/ts.h index 3a6eed6..07a8760 100644 --- a/proxy/api/ts/ts.h +++ b/proxy/api/ts/ts.h @@ -1129,6 +1129,7 @@ extern "C" /* -------------------------------------------------------------------------- Mutexes */ tsapi TSMutex TSMutexCreate(void); + tsapi void TSMutexDestroy(TSMutex mutexp); tsapi void TSMutexLock(TSMutex mutexp); tsapi TSReturnCode TSMutexLockTry(TSMutex mutexp);
