eliminate support for multiple serstatepools: never used and a source of race conditions during shutdown
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									520ca47938
								
							
						
					
					
						commit
						ed551eecc1
					
				
					 9 changed files with 27 additions and 27 deletions
				
			
		| 
						 | 
				
			
			@ -70,7 +70,7 @@ dds_instance_find(
 | 
			
		|||
        _In_ const void *data,
 | 
			
		||||
        _In_ const bool create)
 | 
			
		||||
{
 | 
			
		||||
    serdata_t sd = serialize_key (gv.serpool, topic->m_stopic, data);
 | 
			
		||||
    serdata_t sd = serialize_key (topic->m_stopic, data);
 | 
			
		||||
    struct tkmap_instance * inst = dds_tkmap_find (sd, false, create);
 | 
			
		||||
    ddsi_serdata_unref (sd);
 | 
			
		||||
    return inst;
 | 
			
		||||
| 
						 | 
				
			
			@ -419,7 +419,7 @@ dds_instance_lookup(
 | 
			
		|||
 | 
			
		||||
    topic = dds_instance_info_by_hdl (entity);
 | 
			
		||||
    if (topic) {
 | 
			
		||||
        sd = serialize_key (gv.serpool, topic->m_stopic, data);
 | 
			
		||||
        sd = serialize_key (topic->m_stopic, data);
 | 
			
		||||
        ih = dds_tkmap_lookup (map, sd);
 | 
			
		||||
        ddsi_serdata_unref (sd);
 | 
			
		||||
        ret = DDS_RETCODE_OK;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -212,9 +212,9 @@ dds_write_impl(
 | 
			
		|||
 | 
			
		||||
    /* Serialize and write data or key */
 | 
			
		||||
    if (writekey) {
 | 
			
		||||
        d = serialize_key (gv.serpool, ddsi_wr->topic, data);
 | 
			
		||||
        d = serialize_key (ddsi_wr->topic, data);
 | 
			
		||||
    } else {
 | 
			
		||||
        d = serialize (gv.serpool, ddsi_wr->topic, data);
 | 
			
		||||
        d = serialize (ddsi_wr->topic, data);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Set if disposing or unregistering */
 | 
			
		||||
| 
						 | 
				
			
			@ -287,7 +287,7 @@ dds_writecdr_impl(
 | 
			
		|||
 | 
			
		||||
    /* Serialize and write data or key */
 | 
			
		||||
    {
 | 
			
		||||
      serstate_t st = ddsi_serstate_new (gv.serpool, ddsi_wr->topic);
 | 
			
		||||
      serstate_t st = ddsi_serstate_new (ddsi_wr->topic);
 | 
			
		||||
      dds_stream_t is;
 | 
			
		||||
      ddsi_serstate_append_blob(st, 1, sz, cdr);
 | 
			
		||||
      d = ddsi_serstate_fix(st);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,8 +22,8 @@ extern "C" {
 | 
			
		|||
int serdata_cmp (const struct serdata * a, const struct serdata * b);
 | 
			
		||||
uint32_t serdata_hash (const struct serdata *a);
 | 
			
		||||
 | 
			
		||||
serdata_t serialize (serstatepool_t pool, const struct sertopic * tp, const void * sample);
 | 
			
		||||
serdata_t serialize_key (serstatepool_t pool, const struct sertopic * tp, const void * sample);
 | 
			
		||||
serdata_t serialize (const struct sertopic * tp, const void * sample);
 | 
			
		||||
serdata_t serialize_key (const struct sertopic * tp, const void * sample);
 | 
			
		||||
 | 
			
		||||
void deserialize_into (void *sample, const struct serdata *serdata);
 | 
			
		||||
void free_deserialized (const struct serdata *serdata, void *vx);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,10 +18,10 @@
 | 
			
		|||
#include "ddsi/q_bswap.h"
 | 
			
		||||
#include "q__osplser.h"
 | 
			
		||||
 | 
			
		||||
serdata_t serialize (serstatepool_t pool, const struct sertopic * tp, const void * sample)
 | 
			
		||||
serdata_t serialize (const struct sertopic * tp, const void * sample)
 | 
			
		||||
{
 | 
			
		||||
  dds_stream_t os;
 | 
			
		||||
  serstate_t st = ddsi_serstate_new (pool, tp);
 | 
			
		||||
  serstate_t st = ddsi_serstate_new (tp);
 | 
			
		||||
  dds_key_gen ((const dds_topic_descriptor_t*) tp->type, &st->data->v.keyhash, (char*) sample);
 | 
			
		||||
  dds_stream_from_serstate (&os, st);
 | 
			
		||||
  dds_stream_write_sample (&os, sample, tp);
 | 
			
		||||
| 
						 | 
				
			
			@ -58,12 +58,12 @@ int serdata_cmp (const struct serdata *a, const struct serdata *b)
 | 
			
		|||
  return memcmp (a->v.keyhash.m_hash, b->v.keyhash.m_hash, 16);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
serdata_t serialize_key (serstatepool_t pool, const struct sertopic * tp, const void * sample)
 | 
			
		||||
serdata_t serialize_key (const struct sertopic * tp, const void * sample)
 | 
			
		||||
{
 | 
			
		||||
  serdata_t sd;
 | 
			
		||||
  dds_stream_t os;
 | 
			
		||||
  dds_topic_descriptor_t * desc = (dds_topic_descriptor_t*) tp->type;
 | 
			
		||||
  serstate_t st = ddsi_serstate_new (pool, tp);
 | 
			
		||||
  serstate_t st = ddsi_serstate_new (tp);
 | 
			
		||||
  dds_key_gen (desc, &st->data->v.keyhash, (char*) sample);
 | 
			
		||||
  dds_stream_from_serstate (&os, st);
 | 
			
		||||
  dds_stream_write_key (&os, sample, desc);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue