Re: [Jack-Devel] jconvolver and OSX

PrevNext  Index
DateMon, 28 Feb 2011 12:21:32 +0100
From torbenh <[hidden] at gmx dot de>
ToStéphane Letz <[hidden] at grame dot fr>
Cc[hidden] at lists dot jackaudio dot org
In-Reply-ToStéphane Letz Re: [Jack-Devel] jconvolver and OSX
On Mon, Feb 28, 2011 at 12:12:27PM +0100, Stéphane Letz wrote:
> But then what about this message?
> 
> http://tech.groups.yahoo.com/group/jackosx/message/3305
> 
> Le 28 févr. 2011 à 12:07, Fons Adriaensen a écrit :
> 
> > On Mon, Feb 28, 2011 at 11:36:33AM +0100, Natasha Barrett wrote:
> > 
> > 
> >> I've been trying to install jconvolver under OSX (10.5 / 10.6).  Does  
> >> anyone know if this is at all possible, and if so, any hints?
> > 
> > It is not possible ATM because zita-convolver uses 'anonymous'
> > semaphores (sem_t, semaphore.h) which are not available in OSX.
> 
> Why not using named semaphore ? (available on OSX)

requires housekeeping. thats annoying.

anyways... maybe you can just adapt from ardours semaphore:

/*
    Copyright (C) 2010 Paul Davis

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "pbd/semutils.h"
#include "pbd/failed_constructor.h"

using namespace PBD;

ProcessSemaphore::ProcessSemaphore (const char* name, int val)
{
#ifdef __APPLE__
	if ((_sem = sem_open (name, O_CREAT, 0600, val)) == (sem_t*) SEM_FAILED) {
		throw failed_constructor ();
	}

	/* this semaphore does not exist for IPC */
	
	if (sem_unlink (name)) {
		throw failed_constructor ();
	}

#else
	if (sem_init (&_sem, 0, val)) {
		throw failed_constructor ();
	}
#endif
}

ProcessSemaphore::~ProcessSemaphore ()
{
#ifdef __APPLE__
	sem_close (ptr_to_sem());
#endif
}


> 
> > 
> > I've been told you can have the same functionality in OSX using
> > the Mach semaphores. If anyone can provide example source code to
> > do this I could abstract that and Linux's sem_t into a C++ class
> > and make the zita-convolver code portable to OSX.
> > 
> > It's probably a trivial thing to do for anyone familiar with
> > this sort of stuff.
> > 
> > Ciao,
> 
> Stéphane
> 
> 
> 
> Jack-Devel mailing list
> [hidden]
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

-- 
torben Hohn
PrevNext  Index

1298892117.14980_0.ltw:2,a <20110228112132.GF2977 at siel dot b>