RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-5_3: rpm/ CHANGES rpm/rpmio/ yarn.c yarn.h

From: Jeff Johnson <jbj@rpm5.org>
Date: Mon 20 Sep 2010 - 20:17:35 CEST
Message-Id: <20100920181735.73014D493D@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   20-Sep-2010 20:17:35
  Branch: rpm-5_3                          Handle: 2010092018173401

  Modified files:           (Branch: rpm-5_3)
    rpm                     CHANGES
    rpm/rpmio               yarn.c yarn.h

  Log:
    - yarn: add yarnLaunchStack() to create a yarnThread with a stack.

  Summary:
    Revision    Changes     Path
    1.3296.2.76 +1  -0      rpm/CHANGES
    2.10.4.1    +14 -5      rpm/rpmio/yarn.c
    2.3.6.1     +5  -0      rpm/rpmio/yarn.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3296.2.75 -r1.3296.2.76 CHANGES
  --- rpm/CHANGES	19 Sep 2010 03:32:04 -0000	1.3296.2.75
  +++ rpm/CHANGES	20 Sep 2010 18:17:34 -0000	1.3296.2.76
  @@ -1,4 +1,5 @@
   5.3.3 -> 5.3.4:
  +    - yarn: add yarnLaunchStack() to create a yarnThread with a stack.
       - jbj: ruby: don't load stringio for now, there's a segfault here.
       - jbj: ruby: wire-up a global interpreter always.
       - jbj: autofu: hot-wire ruby-1.9.2p0 embedding.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/yarn.c
  ============================================================================
  $ cvs diff -u -r2.10 -r2.10.4.1 yarn.c
  --- rpm/rpmio/yarn.c	18 Mar 2009 16:07:40 -0000	2.10
  +++ rpm/rpmio/yarn.c	20 Sep 2010 18:17:35 -0000	2.10.4.1
  @@ -431,7 +431,8 @@
   
   /* not all POSIX implementations create threads as joinable by default, so that
      is made explicit here */
  -yarnThread yarnLaunch(void (*probe)(void *), void * payload)
  +yarnThread yarnLaunchStack(void (*probe)(void *), void * payload,
  +		void * stack, size_t nstack)
   	/*@globals threads @*/
   	/*@modifies threads @*/
   {
  @@ -458,10 +459,11 @@
   
       /* create the thread and call yarnIgnition() from that thread */
       th = my_malloc(sizeof(*th));
  -    if ((ret = pthread_attr_init(&attr)) ||
  -        (ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)) ||
  -        (ret = pthread_create(&(th->id), &attr, yarnIgnition, capsule)) ||
  -        (ret = pthread_attr_destroy(&attr)))
  +    if ((ret = pthread_attr_init(&attr))
  +     || (ret = (stack ? pthread_attr_setstack(&attr, stack, nstack) : 0))
  +     || (ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE))
  +     || (ret = pthread_create(&(th->id), &attr, yarnIgnition, capsule))
  +     || (ret = pthread_attr_destroy(&attr)))
           fail(ret);
   
       /* put the thread in the threads list for yarnJoinAll() */
  @@ -474,6 +476,13 @@
   /*@=dependenttrans =globstate =mustfreefresh =retalias @*/
   }
   
  +yarnThread yarnLaunch(void (*probe)(void *), void * payload)
  +	/*@globals threads @*/
  +	/*@modifies threads @*/
  +{
  +    return yarnLaunchStack(probe, payload, NULL, 0);
  +}
  +
   yarnThread yarnJoin(yarnThread ally)
   	/*@globals threads, threads_lock @*/
   	/*@modifies threads, threads_lock @*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/yarn.h
  ============================================================================
  $ cvs diff -u -r2.3 -r2.3.6.1 yarn.h
  --- rpm/rpmio/yarn.h	6 Mar 2009 17:00:32 -0000	2.3
  +++ rpm/rpmio/yarn.h	20 Sep 2010 18:17:35 -0000	2.3.6.1
  @@ -128,6 +128,11 @@
   
   typedef struct yarnThread_s * yarnThread;
   /*@only@*/
  +yarnThread yarnLaunchStack(void (*probe)(void *), void *payload,
  +		/*@null@*/ void * stack, size_t nstack)
  +	/*@globals fileSystem, internalState @*/
  +	/*@modifies fileSystem, internalState @*/;
  +/*@only@*/
   yarnThread yarnLaunch(void (*probe)(void *), void *payload)
   	/*@globals fileSystem, internalState @*/
   	/*@modifies fileSystem, internalState @*/;
  @@ .
Received on Mon Sep 20 20:17:35 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.