summaryrefslogtreecommitdiff
path: root/algo/blast/core/hspstream_collector.c
diff options
context:
space:
mode:
Diffstat (limited to 'algo/blast/core/hspstream_collector.c')
-rw-r--r--algo/blast/core/hspstream_collector.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/algo/blast/core/hspstream_collector.c b/algo/blast/core/hspstream_collector.c
index ec1d1c23..2565f086 100644
--- a/algo/blast/core/hspstream_collector.c
+++ b/algo/blast/core/hspstream_collector.c
@@ -1,4 +1,4 @@
-/* $Id: hspstream_collector.c,v 1.14 2005/05/16 12:21:40 madden Exp $
+/* $Id: hspstream_collector.c,v 1.15 2005/09/30 12:17:10 madden Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -34,7 +34,7 @@
#ifndef SKIP_DOXYGEN_PROCESSING
static char const rcsid[] =
- "$Id: hspstream_collector.c,v 1.14 2005/05/16 12:21:40 madden Exp $";
+ "$Id: hspstream_collector.c,v 1.15 2005/09/30 12:17:10 madden Exp $";
#endif /* SKIP_DOXYGEN_PROCESSING */
@@ -154,6 +154,7 @@ static int
s_BlastHSPListCollectorWrite(BlastHSPStream* hsp_stream,
BlastHSPList** hsp_list)
{
+ Int2 status = 0;
BlastHSPListCollectorData* stream_data =
(BlastHSPListCollectorData*) GetData(hsp_stream);
@@ -166,18 +167,24 @@ s_BlastHSPListCollectorWrite(BlastHSPStream* hsp_stream,
* every read after a write.
*/
if (stream_data->results_sorted) {
+ MT_LOCK_Do(stream_data->x_lock, eMT_Unlock);
return kBlastHSPStream_Error;
}
/* For RPS BLAST saving procedure is different, because HSPs from different
subjects are bundled in one HSP list */
if (Blast_ProgramIsRpsBlast(stream_data->program)) {
- Blast_HSPResultsSaveRPSHSPList(stream_data->program,
+ status = Blast_HSPResultsSaveRPSHSPList(stream_data->program,
stream_data->results, *hsp_list, stream_data->blasthit_params);
} else {
- Blast_HSPResultsSaveHSPList(stream_data->program, stream_data->results,
+ status = Blast_HSPResultsSaveHSPList(stream_data->program, stream_data->results,
*hsp_list, stream_data->blasthit_params);
}
+ if (status != 0)
+ {
+ MT_LOCK_Do(stream_data->x_lock, eMT_Unlock);
+ return kBlastHSPStream_Error;
+ }
/* Results structure is no longer sorted, even if it was before.
The following assignment is only necessary if the logic to prohibit
writing after the first read is removed. */