pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/50780: net/zeromq broken on NetBSD current



The following reply was made to PR pkg/50780; it has been noted by GNATS.

From: Yuval Langer <yuval.langer%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/50780: net/zeromq broken on NetBSD current
Date: Sun, 3 Apr 2016 02:00:08 +0300

 I made a mistake in the previous message.
 
 $NetBSD$
 
 --- src/thread.cpp.orig     2015-06-15 09:43:08.000000000 +0000
 +++ src/thread.cpp
 @@ -77,6 +77,7 @@ void zmq::thread_t::setSchedulingParamet
  #else
 
  #include <signal.h>
 +#include <sys/param.h>
 
  extern "C"
  {
 @@ -131,6 +132,8 @@ void zmq::thread_t::setSchedulingParamet
          policy = schedulingPolicy_;
      }
 
 +    if(policy == SCHED_OTHER) param.sched_priority = PRI_NONE;
 +
      rc = pthread_setschedparam(descriptor, policy, &param);
      posix_assert (rc);
  #endif
 
 An alternative solution is to use `-1` instead of `PRI_NONE` and to
 not `#include <sys/param.h>`.
 
 $NetBSD$
 
 --- src/thread.cpp.orig    2015-06-15 09:43:08.000000000 +0000
 +++ src/thread.cpp
 @@ -131,6 +131,8 @@ void zmq::thread_t::setSchedulingParamet
          policy = schedulingPolicy_;
      }
 
 +    if(policy == SCHED_OTHER) param.sched_priority = -1;
 +
      rc = pthread_setschedparam(descriptor, policy, &param);
      posix_assert (rc);
  #endif
 
 On 3 April 2016 at 01:10, Yuval Langer <yuval.langer%gmail.com@localhost> wrote:
 > A new solution from riastradh%netbsd.org@localhost and kamil%netbsd.org@localhost (ryoshu):
 >
 >
 > $NetBSD$
 >
 > --- src/thread.cpp.orig        2015-06-15 09:43:08.000000000 +0000
 > +++ src/thread.cpp
 > @@ -114,26 +114,28 @@ void zmq::thread_t::stop ()
 >
 >  void zmq::thread_t::setSchedulingParameters(int priority_, int
 > schedulingPolicy_)
 >  {
 >  #if !defined ZMQ_HAVE_ZOS
 >      int policy = 0;
 >      struct sched_param param;
 >
 >      int rc = pthread_getschedparam(descriptor, &policy, &param);
 >      posix_assert (rc);
 >
 >      if(priority_ != -1)
 >      {
 >          param.sched_priority = priority_;
 >      }
 >
 >      if(schedulingPolicy_ != -1)
 >      {
 >          policy = schedulingPolicy_;
 >      }
 >
 > +    if(policy == SCHED_OTHER) priority = PRI_NONE;
 > +
 >      rc = pthread_setschedparam(descriptor, policy, &param);
 >      posix_assert (rc);
 >  #endif
 >  }
 >
 >  #endif
 >
 > On 3 April 2016 at 00:40, Yuval Langer <yuval.langer%gmail.com@localhost> wrote:
 >> I have received the following possible solution to this problem from ryoshu:
 >>
 >> $NetBSD$
 >>
 >> --- src/thread.cpp.orig        2015-06-15 09:43:08.000000000 +0000
 >> +++ src/thread.cpp
 >> @@ -114,26 +114,28 @@ void zmq::thread_t::stop ()
 >>
 >>  void zmq::thread_t::setSchedulingParameters(int priority_, int
 >> schedulingPolicy_)
 >>  {
 >>  #if !defined ZMQ_HAVE_ZOS
 >>      int policy = 0;
 >>      struct sched_param param;
 >>
 >>      int rc = pthread_getschedparam(descriptor, &policy, &param);
 >>      posix_assert (rc);
 >>
 >>      if(priority_ != -1)
 >>      {
 >>          param.sched_priority = priority_;
 >>      }
 >>
 >>      if(schedulingPolicy_ != -1)
 >>      {
 >>          policy = schedulingPolicy_;
 >>      }
 >>
 >> +    if(policy == SCHED_OTHER) return;
 >> +
 >>      rc = pthread_setschedparam(descriptor, policy, &param);
 >>      posix_assert (rc);
 >>  #endif
 >>  }
 >>
 >>  #endif
 


Home | Main Index | Thread Index | Old Index