@@ -325,12 +325,18 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
325
325
#ifdef THREAD
326
326
typedef struct st_io_cache_share
327
327
{
328
- /* to sync on reads into buffer */
329
- pthread_mutex_t mutex ;
330
- pthread_cond_t cond ;
331
- int count , total ;
332
- /* actual IO_CACHE that filled the buffer */
333
- struct st_io_cache * active ;
328
+ pthread_mutex_t mutex ; /* To sync on reads into buffer. */
329
+ pthread_cond_t cond ; /* To wait for signals. */
330
+ pthread_cond_t cond_writer ; /* For a synchronized writer. */
331
+ /* Offset in file corresponding to the first byte of buffer. */
332
+ my_off_t pos_in_file ;
333
+ /* If a synchronized write cache is the source of the data. */
334
+ struct st_io_cache * source_cache ;
335
+ byte * buffer ; /* The read buffer. */
336
+ byte * read_end ; /* Behind last valid byte of buffer. */
337
+ int running_threads ; /* threads not in lock. */
338
+ int total_threads ; /* threads sharing the cache. */
339
+ int error ; /* Last error. */
334
340
#ifdef NOT_YET_IMPLEMENTED
335
341
/* whether the structure should be free'd */
336
342
my_bool alloced ;
@@ -672,8 +678,8 @@ extern void setup_io_cache(IO_CACHE* info);
672
678
extern int _my_b_read (IO_CACHE * info ,byte * Buffer ,uint Count );
673
679
#ifdef THREAD
674
680
extern int _my_b_read_r (IO_CACHE * info ,byte * Buffer ,uint Count );
675
- extern void init_io_cache_share (IO_CACHE * info ,
676
- IO_CACHE_SHARE * s , uint num_threads );
681
+ extern void init_io_cache_share (IO_CACHE * read_cache , IO_CACHE_SHARE * cshare ,
682
+ IO_CACHE * write_cache , uint num_threads );
677
683
extern void remove_io_thread (IO_CACHE * info );
678
684
#endif
679
685
extern int _my_b_seq_read (IO_CACHE * info ,byte * Buffer ,uint Count );
0 commit comments