Skip to content

Commit

Permalink
Merge commit '44c89d6565bacc0f990d7fa85347ba32b31a18e8'
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Nov 7, 2012
2 parents 77662e1 + 44c89d6 commit d35b78f
Show file tree
Hide file tree
Showing 19 changed files with 3,924 additions and 3,777 deletions.
5 changes: 5 additions & 0 deletions VFLib/Builds/VisualStudio2010/VFLib.vcxproj
Expand Up @@ -109,6 +109,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\modules\vf_concurrent\threads\vf_SharedObject.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\vf_concurrent\threads\vf_ThreadGroup.cpp"> <ClCompile Include="..\..\modules\vf_concurrent\threads\vf_ThreadGroup.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -513,6 +517,7 @@
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ReadWriteMutex.h" /> <ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ReadWriteMutex.h" />
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ConcurrentObject.h" /> <ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ConcurrentObject.h" />
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ConcurrentState.h" /> <ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ConcurrentState.h" />
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_SharedObject.h" />
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ThreadGroup.h" /> <ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ThreadGroup.h" />
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ThreadWithCallQueue.h" /> <ClInclude Include="..\..\modules\vf_concurrent\threads\vf_ThreadWithCallQueue.h" />
<ClInclude Include="..\..\modules\vf_concurrent\vf_concurrent.h" /> <ClInclude Include="..\..\modules\vf_concurrent\vf_concurrent.h" />
Expand Down
6 changes: 6 additions & 0 deletions VFLib/Builds/VisualStudio2010/VFLib.vcxproj.filters
Expand Up @@ -516,6 +516,9 @@
<ClCompile Include="..\..\modules\vf_unfinished\graphics\vf_PatternOverlayStyle.cpp"> <ClCompile Include="..\..\modules\vf_unfinished\graphics\vf_PatternOverlayStyle.cpp">
<Filter>VF Modules\vf_unfinished\graphics</Filter> <Filter>VF Modules\vf_unfinished\graphics</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\modules\vf_concurrent\threads\vf_SharedObject.cpp">
<Filter>VF Modules\vf_concurrent\threads</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\modules\vf_db\api\backend.h"> <ClInclude Include="..\..\modules\vf_db\api\backend.h">
Expand Down Expand Up @@ -1007,6 +1010,9 @@
<ClInclude Include="..\..\modules\vf_unfinished\graphics\vf_PatternFill.h"> <ClInclude Include="..\..\modules\vf_unfinished\graphics\vf_PatternFill.h">
<Filter>VF Modules\vf_unfinished\graphics</Filter> <Filter>VF Modules\vf_unfinished\graphics</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\modules\vf_concurrent\threads\vf_SharedObject.h">
<Filter>VF Modules\vf_concurrent\threads</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\README.md" /> <None Include="..\..\README.md" />
Expand Down
4 changes: 2 additions & 2 deletions VFLib/modules/vf_concurrent/threads/vf_ConcurrentObject.cpp
Expand Up @@ -30,12 +30,12 @@
*/ */
/*============================================================================*/ /*============================================================================*/


class ConcurrentObject::Deleter class ConcurrentObject::Deleter : private ThreadWithCallQueue::EntryPoints
{ {
private: private:
Deleter () : m_thread ("AsyncDeleter") Deleter () : m_thread ("AsyncDeleter")
{ {
m_thread.start (); m_thread.start (this);
} }


~Deleter () ~Deleter ()
Expand Down
5 changes: 4 additions & 1 deletion VFLib/modules/vf_concurrent/threads/vf_GuiCallQueue.cpp
Expand Up @@ -30,6 +30,9 @@
*/ */
/*============================================================================*/ /*============================================================================*/


// This thread is used so that we don't call triggerAsyncUpdate() from any
// audio device I/O callback or other performance-sensitive threads.
//
GuiCallQueue::GuiCallQueue () GuiCallQueue::GuiCallQueue ()
: CallQueue ("GuiCallQueue") : CallQueue ("GuiCallQueue")
, m_thread ("GuiCallQueue") , m_thread ("GuiCallQueue")
Expand All @@ -42,7 +45,7 @@ GuiCallQueue::GuiCallQueue ()
// //
synchronize (); synchronize ();


m_thread.start (); m_thread.start (this);
} }


void GuiCallQueue::close () void GuiCallQueue::close ()
Expand Down
1 change: 1 addition & 0 deletions VFLib/modules/vf_concurrent/threads/vf_GuiCallQueue.h
Expand Up @@ -53,6 +53,7 @@
class GuiCallQueue class GuiCallQueue
: public CallQueue : public CallQueue
, private AsyncUpdater , private AsyncUpdater
, private ThreadWithCallQueue::EntryPoints
{ {
public: public:
/** Create a GuiCallQueue. /** Create a GuiCallQueue.
Expand Down
49 changes: 49 additions & 0 deletions VFLib/modules/vf_concurrent/threads/vf_SharedObject.cpp
@@ -0,0 +1,49 @@
/*============================================================================*/
/*
VFLib: https://github.com/vinniefalco/VFLib
Copyright (C) 2008 by Vinnie Falco <vinnie.falco@gmail.com>
This library contains portions of other open source products covered by
separate licenses. Please see the corresponding source files for specific
terms.
VFLib is provided under the terms of The MIT License (MIT):
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
/*============================================================================*/

SharedObject::ThreadedScope::ThreadedScope (char const* name)
: m_thread (name)
{
m_thread.start (this);
}

void SharedObject::ThreadedScope::destroySharedObject (SharedObject* const object)
{
deleteAsync (object);
}

//------------------------------------------------------------------------------

void SharedObject::destroySharedObject ()
{
delete this;
}

0 comments on commit d35b78f

Please sign in to comment.