Skip to content

Commit

Permalink
Back out consistent create_thread ATTR modification
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/jj/hercules.svn/trunk@4905 956126f8-22a0-4046-8f4a-272fa8102e63
  • Loading branch information
Roger Bowler committed Nov 3, 2008
1 parent d45ab9a commit 6302d56
Show file tree
Hide file tree
Showing 24 changed files with 128 additions and 56 deletions.
3 changes: 1 addition & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
02 Nov 2008 Correction to dasdtab entries for 3375 and 3380 - Roger Bowler
01 Nov 2008 Fix tapedev gettapetype_bydata function for HET/AWS tapes that
start with a tapemark -- Liam Cold [[email protected]] by Fish
26 Oct 2008 Store_is within CMPSC will zero the remaining bits in the working byte,
26 Oct 2008 Store_is within CMPSC will zero the remaining bits in the working byte,
just like other famous manufacturers will do. All former generated compressed
code will expand correctly, don't worry!! But their can be a difference
in the compressed output. (This is the case when bits are on, but those
are the unused bits after the last index symbol). - Bernard van der Helm
24 Oct 2008 Fix RC file not processed nor HAO thread engaged if -d daemon mode - Fish
18 Oct 2008 Fix diag 0x308 re-IPL and ensure consistent create_thread ATTR usage - Fish
11 Oct 2008 Fix MSVC build failure when 'rebase' utility doesn't exist - Fish
07 Sep 2008 Fix zero ilc problem after branch trace - Greg
04 Sep 2008 Fix 64-bit length problem in cdsk_valid_trk - Tony Harminc by Greg
Expand Down
7 changes: 5 additions & 2 deletions bldcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.90 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.89 2008/10/14 22:41:08 rbowler
// Add ENGINES configuration statement
//
Expand Down Expand Up @@ -2559,8 +2562,8 @@ char pathname[MAX_PATH]; /* file path in host format */
initialize_lock (&sysblk.iointqlk);
sysblk.intowner = LOCK_OWNER_NONE;
initialize_lock (&sysblk.sigplock);
// initialize_detach_attr (&sysblk.detattr); // (moved to impl.c)
// initialize_join_attr (&sysblk.joinattr); // (moved to impl.c)
initialize_detach_attr (&sysblk.detattr);
initialize_join_attr (&sysblk.joinattr);
initialize_condition (&sysblk.cpucond);
for (i = 0; i < MAX_CPU_ENGINES; i++)
initialize_lock (&sysblk.cpulock[i]);
Expand Down
16 changes: 10 additions & 6 deletions cckddasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.144 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.143 2008/01/04 03:35:30 gsmith
// Fix to sf- command - Thanks Christopher!
//
Expand Down Expand Up @@ -192,6 +195,7 @@ int i, j; /* Loop indexes */
initialize_condition (&cckdblk.wrcond);
initialize_condition (&cckdblk.devcond);
initialize_condition (&cckdblk.termcond);
initialize_join_attr (&cckdblk.attr);

/* Initialize some variables */
cckdblk.wrprio = 16;
Expand Down Expand Up @@ -1467,7 +1471,7 @@ TID tid; /* Readahead thread id */
if (cckdblk.rawaiting)
signal_condition (&cckdblk.racond);
else if (cckdblk.ras < cckdblk.ramax)
create_thread (&tid, JOINABLE, cckd_ra, NULL, "cckd_ra");
create_thread (&tid, &cckdblk.attr, cckd_ra, NULL, "cckd_ra");
}

release_lock (&cckdblk.ralock);
Expand Down Expand Up @@ -1555,7 +1559,7 @@ TID tid; /* Readahead thread id */
if (cckdblk.rawaiting)
signal_condition (&cckdblk.racond);
else if (cckdblk.ras < cckdblk.ramax)
create_thread (&tid, JOINABLE, cckd_ra, dev, "cckd_ra");
create_thread (&tid, &cckdblk.attr, cckd_ra, dev, "cckd_ra");
}

if (!cckd || cckd->stopping || cckd->merging) continue;
Expand Down Expand Up @@ -1603,7 +1607,7 @@ TID tid; /* Writer thread id */
signal_condition (&cckdblk.wrcond);
else if (cckdblk.wrs < cckdblk.wrmax)
{
create_thread (&tid, JOINABLE, cckd_writer, NULL, "cckd_writer");
create_thread (&tid, &cckdblk.attr, cckd_writer, NULL, "cckd_writer");
}
}
release_lock (&cckdblk.wrlock);
Expand Down Expand Up @@ -1757,7 +1761,7 @@ BYTE buf2[65536]; /* Compress buffer */
signal_condition (&cckdblk.wrcond);
else if (cckdblk.wrs < cckdblk.wrmax)
{
create_thread (&tid, JOINABLE, cckd_writer, NULL, "cckd_writer");
create_thread (&tid, &cckdblk.attr, cckd_writer, NULL, "cckd_writer");
}
}
release_lock (&cckdblk.wrlock);
Expand Down Expand Up @@ -1822,7 +1826,7 @@ BYTE buf2[65536]; /* Compress buffer */

/* Schedule the garbage collector */
if (cckdblk.gcs < cckdblk.gcmax)
create_thread (&tid, JOINABLE, cckd_gcol, NULL, "cckd_gcol");
create_thread (&tid, &cckdblk.attr, cckd_gcol, NULL, "cckd_gcol");

obtain_lock (&cckd->iolock);
cache_lock (CACHE_DEVBUF);
Expand Down Expand Up @@ -5620,7 +5624,7 @@ int val, opts = 0;
}
cckd_unlock_devchain();
if (flag && cckdblk.gcs < cckdblk.gcmax)
create_thread (&tid, JOINABLE, cckd_gcol, NULL, "cckd_gcol");
create_thread (&tid, &cckdblk.attr, cckd_gcol, NULL, "cckd_gcol");
}
else
{
Expand Down
7 changes: 5 additions & 2 deletions channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.145 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.144 2008/08/21 18:34:45 fish
// Fix i/o-interrupt-queue race condition
//
Expand Down Expand Up @@ -2344,7 +2347,7 @@ DEVBLK *previoq, *ioq; /* Device I/O queue pointers */
signal_condition(&sysblk.ioqcond);
else if (sysblk.devtmax == 0 || sysblk.devtnbr < sysblk.devtmax)
{
rc = create_thread (&dev->tid, DETACHED,
rc = create_thread (&dev->tid, &sysblk.detattr,
device_thread, NULL, "idle device thread");
if (rc != 0 && sysblk.devtnbr == 0)
{
Expand All @@ -2368,7 +2371,7 @@ DEVBLK *previoq, *ioq; /* Device I/O queue pointers */
thread_name[sizeof(thread_name)-1]=0;

/* Execute the CCW chain on a separate thread */
if ( create_thread (&dev->tid, DETACHED,
if ( create_thread (&dev->tid, &sysblk.detattr,
ARCH_DEP(execute_ccw_chain), dev, thread_name) )
{
logmsg (_("HHCCP068E %4.4X create_thread error: %s"),
Expand Down
5 changes: 4 additions & 1 deletion commadpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// $Id$
//
// $Log$
// Revision 1.45 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.44 2008/03/04 01:10:29 ivan
// Add LEGACYSENSEID config statement to allow X'E4' Sense ID on devices
// that originally didn't support it. Defaults to off for compatibility reasons
Expand Down Expand Up @@ -1671,7 +1674,7 @@ static int commadpt_init_handler (DEVBLK *dev, int argc, char *argv[])
thread_name[sizeof(thread_name)-1]=0;

dev->commadpt->curpending=COMMADPT_PEND_TINIT;
if(create_thread(&dev->commadpt->cthread,DETACHED,commadpt_thread,dev->commadpt,thread_name))
if(create_thread(&dev->commadpt->cthread,&sysblk.detattr,commadpt_thread,dev->commadpt,thread_name))
{
logmsg(D_("HHCCA022E create_thread: %s\n"),strerror(errno));
release_lock(&dev->commadpt->lock);
Expand Down
5 changes: 4 additions & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.201 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.200 2008/07/08 05:35:49 fish
// AUTOMOUNT redesign: support +allowed/-disallowed dirs
// and create associated 'automount' panel command - Fish
Expand Down Expand Up @@ -119,7 +122,7 @@ char thread_name[16];
snprintf(thread_name,sizeof(thread_name),"cpu%d thread",cpu);
thread_name[sizeof(thread_name)-1]=0;

if ( create_thread (&sysblk.cputid[cpu], DETACHED, cpu_thread,
if ( create_thread (&sysblk.cputid[cpu], &sysblk.detattr, cpu_thread,
&cpu, thread_name)
)
{
Expand Down
7 changes: 5 additions & 2 deletions console.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.95 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.94 2007/11/21 22:54:14 fish
// Use new BEGIN_DEVICE_CLASS_QUERY macro
//
Expand Down Expand Up @@ -2136,7 +2139,7 @@ BYTE unitstat; /* Status after receive data */
}

/* Create a thread to complete the client connection */
if ( create_thread (&tidneg, DETACHED,
if ( create_thread (&tidneg, &sysblk.detattr,
connect_client, &csock, "connect_client")
)
{
Expand Down Expand Up @@ -2278,7 +2281,7 @@ console_initialise()

if (!sysblk.cnsltid)
{
if ( create_thread (&sysblk.cnsltid, DETACHED,
if ( create_thread (&sysblk.cnsltid, &sysblk.detattr,
console_connection_handler, NULL,
"console_connection_handler")
)
Expand Down
5 changes: 4 additions & 1 deletion cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.203 2008/10/18 09:32:20 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.202 2008/10/07 22:24:35 gsmith
// Fix zero ilc problem after branch trace
//
Expand Down Expand Up @@ -1263,7 +1266,7 @@ int cpu = *ptr;
/* Start the TOD clock and CPU timer thread */
if (!sysblk.todtid)
{
if ( create_thread (&sysblk.todtid, DETACHED,
if ( create_thread (&sysblk.todtid, &sysblk.detattr,
timer_update_thread, NULL, "timer_update_thread") )
{
logmsg (_("HHCCP006S Cannot create timer thread: %s\n"),
Expand Down
5 changes: 4 additions & 1 deletion ctc_ctci.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
// $Id$
//
// $Log$
// Revision 1.75 2008/10/18 09:32:21 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.74 2008/07/17 07:19:12 fish
// Fix FCS (Frame Check Sequence) bug in LCS_Write function
// and other minor bugs.
Expand Down Expand Up @@ -349,7 +352,7 @@ int CTCI_Init( DEVBLK* pDEVBLK, int argc, char *argv[] )

snprintf(thread_name,sizeof(thread_name),"CTCI %4.4X ReadThread",pDEVBLK->devnum);
thread_name[sizeof(thread_name)-1]=0;
create_thread( &pDevCTCBLK->tid, JOINABLE, CTCI_ReadThread, pDevCTCBLK, thread_name );
create_thread( &pDevCTCBLK->tid, &sysblk.joinattr, CTCI_ReadThread, pDevCTCBLK, thread_name );

pDevCTCBLK->pDEVBLK[0]->tid = pDevCTCBLK->tid;
pDevCTCBLK->pDEVBLK[1]->tid = pDevCTCBLK->tid;
Expand Down
7 changes: 6 additions & 1 deletion ctc_lcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// $Id$
//
// $Log$
// Revision 1.77 2008/10/18 09:32:21 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.76 2008/08/19 21:36:37 fish
// Init LCS interface ASAP to fix wrong MAC being used
//
Expand Down Expand Up @@ -353,6 +356,7 @@ int LCS_Init( DEVBLK* pDEVBLK, int argc, char *argv[] )
// previous pass. More than one interface can exist on a port.
if( !pLCSBLK->Port[pLCSDev->bPort].fCreated )
{
ATTR thread_attr;
int rc;

rc = TUNTAP_CreateInterface( pLCSBLK->pszTUNDevice,
Expand Down Expand Up @@ -393,8 +397,9 @@ int LCS_Init( DEVBLK* pDEVBLK, int argc, char *argv[] )
pLCSBLK->Port[pLCSDev->bPort].fUsed = 1;
pLCSBLK->Port[pLCSDev->bPort].fCreated = 1;

initialize_join_attr( &thread_attr );
create_thread( &pLCSBLK->Port[pLCSDev->bPort].tid,
JOINABLE, LCS_PortThread,
&thread_attr, LCS_PortThread,
&pLCSBLK->Port[pLCSDev->bPort],
"LCS_PortThread" );

Expand Down
5 changes: 4 additions & 1 deletion ctcadpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// $Id$
//
// $Log$
// Revision 1.73 2008/10/18 09:32:21 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.72 2008/07/17 07:19:12 fish
// Fix FCS (Frame Check Sequence) bug in LCS_Write function
// and other minor bugs.
Expand Down Expand Up @@ -664,7 +667,7 @@ static int CTCT_Init( DEVBLK *dev, int argc, char *argv[] )
arg->dev = dev;
snprintf(str,sizeof(str),"CTCT %4.4X ListenThread",dev->devnum);
str[sizeof(str)-1]=0;
create_thread( &tid, JOINABLE, CTCT_ListenThread, arg, str );
create_thread( &tid, &sysblk.joinattr, CTCT_ListenThread, arg, str );
}
else // successfully connected (outbound) to the other end
{
Expand Down
12 changes: 9 additions & 3 deletions diagnose.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.50 2008/10/18 09:31:04 fish
// Fix diag 0x308 re-IPL
//
// Revision 1.49 2008/08/04 22:06:00 rbowler
// DIAG308 function codes for Program-directed re-IPL
//
Expand Down Expand Up @@ -169,6 +172,11 @@ void *stop_cpus_and_ipl(int *ipltype)
void ARCH_DEP(diagnose_call) (VADR effective_addr2, int b2,
int r1, int r2, REGS *regs)
{
#ifdef FEATURE_PROGRAM_DIRECTED_REIPL
ATTR attr; /* Thread attribute */
TID tid; /* Thread identifier */
char *ipltype; /* "ipl" or "iplc" */
#endif /*FEATURE_PROGRAM_DIRECTED_REIPL*/
#ifdef FEATURE_HERCULES_DIAGCALLS
U32 n; /* 32-bit operand value */
#endif /*FEATURE_HERCULES_DIAGCALLS*/
Expand Down Expand Up @@ -581,15 +589,13 @@ U32 code;
/*---------------------------------------------------------------*/
switch(r2) {
#ifdef FEATURE_PROGRAM_DIRECTED_REIPL
TID tid; /* Thread identifier */
char *ipltype; /* "ipl" or "iplc" */
case DIAG308_IPL_CLEAR:
ipltype = "iplc";
goto diag308_cthread;
case DIAG308_IPL_NORMAL:
ipltype = "ipl";
diag308_cthread:
if(create_thread(&tid, DETACHED, stop_cpus_and_ipl, ipltype, "Stop cpus and ipl"))
if(create_thread(&tid, &attr, stop_cpus_and_ipl, ipltype, "Stop cpus and ipl"))
logmsg("HHCDN004E Error starting thread in diagnose 0x308: %s\n",
strerror(errno));
regs->cpustate = CPUSTATE_STOPPING;
Expand Down
5 changes: 4 additions & 1 deletion hao.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
// $Id$
//
// $Log$
// Revision 1.11 2008/10/18 09:32:21 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.10 2008/08/23 11:55:23 fish
// Increase max #of rules from 10 to 64
//
Expand Down Expand Up @@ -137,7 +140,7 @@ DLL_EXPORT void hao_initialize(void)
memset(ao_msgbuf, 0, sizeof(ao_msgbuf));

/* Start message monitoring thread */
if ( create_thread (&sysblk.haotid, JOINABLE,
if ( create_thread (&sysblk.haotid, &sysblk.joinattr,
hao_thread, NULL, "hao_thread") )
{
logmsg(_("HHCIN004S Cannot create HAO thread: %s\n"),
Expand Down
17 changes: 10 additions & 7 deletions hsccmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
/*-------------------------------------------------------------------*/

// $Log$
// Revision 1.252 2008/10/18 09:32:21 fish
// Ensure consistent create_thread ATTR usage
//
// Revision 1.251 2008/09/02 06:10:58 fish
// Modified "$TEST" command (test_cmd function) to
// help debug panel MSGHLD (sticky messages) logic
Expand Down Expand Up @@ -329,7 +332,7 @@ int test_cmd(int argc, char *argv[],char *cmdline)
}

if (test_tid)
create_thread( &test_tid, DETACHED, test_thread, NULL, "test thread" );
create_thread( &test_tid, &sysblk.detattr, test_thread, NULL, "test thread" );
else
do_test_msgs();

Expand Down Expand Up @@ -3778,7 +3781,7 @@ int devtmax_cmd(int argc, char *argv[], char *cmdline)
and more threads can be created */

if (sysblk.ioq && (!sysblk.devtmax || sysblk.devtnbr < sysblk.devtmax))
create_thread(&tid, DETACHED, device_thread, NULL, "idle device thread");
create_thread(&tid, &sysblk.detattr, device_thread, NULL, "idle device thread");

/* Wakeup threads in case they need to terminate */
broadcast_condition (&sysblk.ioqcond);
Expand Down Expand Up @@ -3926,19 +3929,19 @@ char c; /* work for sscan */

/* Process the command */
switch (action) {
case '+': if (create_thread(&tid, DETACHED, cckd_sf_add, dev, "sf+ command"))
case '+': if (create_thread(&tid, &sysblk.detattr, cckd_sf_add, dev, "sf+ command"))
cckd_sf_add(dev);
break;
case '-': if (create_thread(&tid, DETACHED, cckd_sf_remove, dev, "sf- command"))
case '-': if (create_thread(&tid, &sysblk.detattr, cckd_sf_remove, dev, "sf- command"))
cckd_sf_remove(dev);
break;
case 'c': if (create_thread(&tid, DETACHED, cckd_sf_comp, dev, "sfc command"))
case 'c': if (create_thread(&tid, &sysblk.detattr, cckd_sf_comp, dev, "sfc command"))
cckd_sf_comp(dev);
break;
case 'd': if (create_thread(&tid, DETACHED, cckd_sf_stats, dev, "sfd command"))
case 'd': if (create_thread(&tid, &sysblk.detattr, cckd_sf_stats, dev, "sfd command"))
cckd_sf_stats(dev);
break;
case 'k': if (create_thread(&tid, DETACHED, cckd_sf_chk, dev, "sfk command"))
case 'k': if (create_thread(&tid, &sysblk.detattr, cckd_sf_chk, dev, "sfk command"))
cckd_sf_chk(dev);
break;
}
Expand Down
Loading

0 comments on commit 6302d56

Please sign in to comment.