[Hamlib-developer] Re: Hamlib-cvs-digest digest, Vol 1 #23 - 2 msgs
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Stephane F. <f4...@fr...> - 2000-11-27 22:42:06
|
On Sun, Nov 26, 2000 at 12:33:28PM -0800, ham...@li... wrote: > Date: Sat, 25 Nov 2000 13:49:40 -0800 > From: Frank Singleton <jav...@us...> > To: ham...@li... > [...] > --- ft747.c 2000/11/25 21:49:34 1.21 > * > ! * 1. Rentrant code, handle static stuff > * 2. rationalise code, more helper functions. > > --- 262,317 ---- > > int ft747_set_freq(RIG *rig, freq_t freq) { > + struct rig_state *rig_s; > + struct ft747_priv_data *p; > + > + static unsigned char bcd[] = { 0,0,0,0 }; /* set freq */ static local variables (kindof "restricted" global variables) were not well suited for reentrant code. And the p_cmd are not either, since the struct would be shared in the data section. Most of the time, reentrant mutexless solutions would make use of variables on the stack (eventually alloca) or dynamic memory allocated on a per thread basis. Anyway, reentrancy is not the primary focus right now :) > --- 130,135 ---- > struct ft747_priv_data { > unsigned char pacing; /* pacing value */ > ! unsigned int read_update_delay; /* depends on pacing value */ > ! unsigned char p_cmd[FT747_CMD_LENGTH]; /* private copy of constructed CAT cmd */ > unsigned char update_data[FT747_STATUS_UPDATE_DATA_LENGTH]; /* returned data */ > }; |