Commit Graph

30 Commits

Author SHA1 Message Date
Marcelo Roberto Jimenez
843b255518 PTHREAD_MUTEX_RECURSIVE on DragonFly is an enum.
SF Bug Tracker - ID: 3104527
Submitted: OBATA Akio ( obache ) - 2010-11-07 07:10:28 BRST

In threadutil/inc/ithread.h, it is expected that
PTHREAD_MUTEX_RECURSIVE is defined as macro. But on DragonFly BSD,
it is defined as enum, so not works as expected.

Attachment patch treat that DragonFly BSD always
have PTHREAD_MUTEX_RECURSIVE.
(cherry picked from commit ff006272b5)
2010-11-07 11:50:27 -02:00
Carl Benson
4d37927c64 patch for taking notice of UPNP_USE_RWLOCK flag in threadutil
By "Carl Benson" <carl.benson@windriver.com>:

I had to do some modifications myself though, because the Android
build system insists on having a file named "util.h" taking precedence
in its include path, libupnp gets confused because of the same filename
in upnp/src/inc/util.h

(hand cherry picked from commit 8e846368e0)
2010-11-01 01:11:21 -02:00
Fabrice Fontaine
fe7a073bc7 Bug fix on burst of GENA notification
When a lot of notifications were generated by a device in a short
period of time then 100% of the CPU was used to reorder those
notifications by pushing back the thread in the job queue. This
mechanism has been modified so now thread sleep 1 ms before being
pushed back into the job queue.

Removing DEFAULT_SCHED_PARAM parameter and use
sched_get_priority_min(DEFAULT_POLICY) instead.
(cherry picked from commit c33b11d09f)
2010-09-28 20:44:06 -03:00
Fabrice Fontaine
4a8c4f5c50 Customize the stack size of the threads used by pupnp through the new THREAD_STACK_SIZE variable
This patch allows a user to customize the stack size of the threads used by
pupnp through the new THREAD_STACK_SIZE variable. This is especially useful
on embedded systems with limited memory where the user can set THREAD_STACK_SIZE
to ITHREAD_STACK_MIN.

However, as this modification can have side effects, I set 0 as the default
value, so threads will continue to use the default stack size of the system
(which varies greatly as stated in
https://computing.llnl.gov/tutorials/pthreads/).
(cherry picked from commit 467f9987a1)
2010-09-18 06:47:34 -03:00
Warwick Harvey
e0806a2116 Take notice of UPNP_USE_RWLOCK flag.
Updated threadutil to use mutexes instead of read-write locks if
UPNP_USE_RWLOCK is false (0).
(cherry picked from commit 2b399b1791)
2010-09-10 22:46:26 -03:00
Marcelo Roberto Jimenez
3fb182aa95 * Added API to ithread, created the following functions:
- int ithread_initialize_library(void);
	- int ithread_cleanup_library(void);
	- int ithread_initialize_thread(void);
	- int ithread_cleanup_thread(void);
	* SF Bug Tracker [ 2876374 ] Access Violation when compiling with Visual Studio 2008
	Submitted: Stulle ( stulleamgym ) - 2009-10-10 19:05

	Hi,

	I am one of the devs of the MorphXT project and I use this lib in some
	other of my projects, too. When I tried to upgrade the lib earlier for one
	of my projects I had to realise that something did not work at first and
	while most of the things were reasonably ease to be fixed. Now, the last
	thing I encountered was not so easy to fix and I am uncertain if my fix is
	any good so I'll just post it here and wait for some comments.

	The problem was that I got an Access Violation when calling "UpnpInit". It
	would call "ithread_rwlock_init(&GlobalHndRWLock, NULL)" which eventually
	led to calling "pthread_cond_init" and I got the error notice at
	"EnterCriticalSection (&ptw32_cond_list_lock);". It appeared that
	"ptw32_cond_list_lock" was NULL. Now, I found two ways to fix this. Firstly
	moving the whole block after at least one of the "ThreadPoolInit" calls
	will fix the issue. Secondly, you could add:
	#ifdef WIN32
	#ifdef PTW32_STATIC_LIB
	// to get the following working we need this... is it a good patch or
	not... I do not know!
	pthread_win32_process_attach_np();
	#endif
	#endif
	right before "ithread_rwlock_init(&GlobalHndRWLock, NULL)".

	Just so you know, I am using libupnp 1.6.6 and libpthreads 2.8.0 and both
	are linked static into the binaries. I am currently using Visual Studio
	2008 for development with Windows being the target OS. Any comment at your
	end?

	Regards, Stulle



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@527 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-03-27 19:46:16 +00:00
Marcelo Roberto Jimenez
bf169e434c libupnp and multi-flows scenario patch
Submited by Carlo Parata from STMicroelectronics.
Hi Roberto and Nektarios,
after an analysis of the problem of libupnp with a multi-flows scenario, I
noticed that the only cause of the freezed system is the ThreadPool
management. There are not mutex problems. In practise, if all threads in the
thread pool are busy executing jobs, a new worker thread should be created if
a job is scheduled (I inspired to tombupnp library). So I solved the problem
with a little patch in threadutil library that you can find attached in this
e-mail. I hope to have helped you.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@514 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-03-21 19:47:19 +00:00
Marcelo Roberto Jimenez
cbbbb14e21 SF Patch Tracker [ 2969188 ] 1.8.0: patch for FreeBSD compilation
Submitted By: Nick Leverton (leveret)
	Fix the order of header inclusion for FreeBSD.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@504 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-03-20 22:09:23 +00:00
Marcelo Roberto Jimenez
943483e8b7 UpnpInet.h is now the only place where winsock2.h and Ws2tcpip.h are included.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@455 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-07-21 22:42:54 +00:00
Marcelo Roberto Jimenez
5c008e3634 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@432 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-10 04:31:44 +00:00
Marcelo Roberto Jimenez
9ca32e0eb4 Removing replicated #defines and using a single source for them, UpnpGlobal.h.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@423 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-06 22:28:46 +00:00
Marcelo Roberto Jimenez
35db3e9bba Header file reordering and sanity. White space patch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@384 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-23 21:55:04 +00:00
Marcelo Roberto Jimenez
0a173ca0c3 Andre Sodermans (wienerschnitzel) patch for building libupnp under
windows systems with VC9.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@335 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-03-22 17:10:29 +00:00
Marcelo Roberto Jimenez
0b39b2ad6c * SF Bug Tracker [ 1902668 ] Cannot compile on MSVC
Submitted By Luke Kim - nereusuj
Version 1.6.5 cannot be compiled because of some changes in 1.6.3.
MSVC does not support stdint.h, gettimeofday(), sys/param.h, const int
variables in array size and Windows does not define _WINDOWS_ but define
_WINDOWS.
* MSVC does not understand "const int"'s as declarators of array
dimensions, we must use #define'd constants.
* Use WIN32 instead of _WINDOWS_ or _WINDOWS.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@331 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-03-09 01:16:58 +00:00
Marcelo Roberto Jimenez
34e18c2444 Removed unused iasnprintf.{c,h} files.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@273 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 11:05:22 +00:00
Marcelo Roberto Jimenez
e156038d5c Removed STATSONLY() macro from ThreadPool.{c,h}.
Removed time() usage from ThreadPool.c.
Fixed STATS = 0 compilation.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@271 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 10:39:57 +00:00
Marcelo Roberto Jimenez
9bfac585af Library was not compiling on FreeBSD 7. Code now no longer uses
ftime(), using gettimeofday() instead. Thanks to Josh Carroll.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@270 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 01:15:53 +00:00
Marcelo Roberto Jimenez
83ee32afb7 Added support for rwlocks.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@232 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-06 02:04:38 +00:00
Marcelo Roberto Jimenez
20905cb7a7 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@229 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 13:09:33 +00:00
Marcelo Roberto Jimenez
9bc187d4c6 * Removing the Dbg_Level, InitLog, SetLogFileNames and CloseLog
defines. These were just aliases, no reason to keep them.
* Changed the comments of the include files that expose the UPnP API
to use only C89 comments and no C99 comments.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@198 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-25 15:02:12 +00:00
Marcelo Roberto Jimenez
4e1240a0a8 Removing some debug macros missed in the previous commit.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@186 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-18 13:43:09 +00:00
Marcelo Roberto Jimenez
2c1dba2942 - Fixed a bug in UpnpPrintf, function could call va_start() and return
befor calling va_end().

- Removed all uses of the DBGONLY(x) macro. A static inline empty
function now is used and the compiler takes care of optimizing it out.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@185 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-18 13:31:21 +00:00
Marcelo Roberto Jimenez
c1e5e4d6a4 SF Tracker [ 1703533 ] Patch to make it compile under FreeBSD
Submitted By: Timothy Redaelli - drittz
I made some patches to make it compile under FreeBSD using
gethostbyaddr_r when supported.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@165 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-28 17:45:34 +00:00
Marcelo Roberto Jimenez
41cb45146c SF Tracker [ 1663004 ] Compile on Cygwin
Submitted By: Jon Foster - jongfoster
	This patch gives basic support for building under Cygwin - it compiles,
	links, and a simple UPnP device application can initialise. I'm not sure
	if it actually works yet, but this is definitely a step in the right
	direction.
	
	Patch is against the 1.4.1 release. Changes are:
	
	* threadutil/inc/ithread.h: Fix the ithread mutex support to use
	documented, portable APIs (if present) rather than the Non-Portable (_NP)
	ones it uses now. This is required because Cygwin implements only the
	portable API.
	
	* threadutil/src/ThreadPool.c: Fake SetPolicyType() to do nothing on Cygwin
	because otherwise it fails. Should probably investigate why it fails and
	add a proper implementation later.
	
	* upnp/src/api/upnpapi.c: On Cygwin, zero out the GlobalHndMutex structure
	before initialising it. Without this, the initialisation fails. This
	appears to be a bug in Cygwin.
	
	* upnp/src/genlib/net/uri/uri.c: Use gethostbyname() on Cygwin.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@151 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-13 03:27:10 +00:00
Marcelo Roberto Jimenez
c6d3d63223 SF Tracker [ 1628562 ] Maximum total jobs patch
Submitted By: 
Fredrik Svensson - svefredrik

Incremented the libray versions and included some comments in the file
configure.ac so that we do not bump the library version excessively,
only the necessary numbers on the next release.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@115 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 19:16:12 +00:00
Nektarios K. Papadopoulos
e9e8ea5636 Revert commenting out definition of STATS. Otherwise compilation with debug is broken.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@90 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-10-09 13:42:09 +00:00
Oxy
ae13c481a7 git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@87 119443c7-1b9e-41f8-b6fc-b9c35fce742c 2006-09-28 17:20:22 +00:00
Oxy
8c21b2c4d9 Windows-port: some special code and switches for statical libraries added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@73 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-31 05:32:33 +00:00
Oxy
ab66940a89 changes for compilation with MS VC++
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@46 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-07 06:58:19 +00:00
Marcelo Roberto Jimenez
89e7a40fcc Removing unnecessary additional directory level.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@29 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:44:17 +00:00